Page MenuHomePhabricator

Imlib2: doesn't load bz2 files with wrong extension
Closed, ResolvedPublic

Description

Hi,

Imlib2 seems to be failing to load bz2 files if the extension is "wrong". To reproduce:

[nrk testing]% imlib2_view pic.png          
[nrk testing]% bzip2 pic.png
[nrk testing]% imlib2_view pic.png.bz2 
[nrk testing]% mv pic.png.bz2 pic.png.something
renamed 'pic.png.bz2' -> 'pic.png.something'
[nrk testing]% imlib2_view pic.png.something 
No loadable image
[nrk testing]%
NRK created this task.Sat, May 7, 12:13 PM
kwo added a comment.Sun, May 8, 10:37 AM

Yeah, I think that this more or less intentionally has not worked ever (same thing with .gz and .xz loaders).
It is quite trivial to fix, but are there good reasons one way or the other - to allow this or leave it as is?
The next issue might become that if you rename pic.png.bz2 to pic.foo.bz2 that image won't load.
But that may be ok - avoiding potentially wasting time on decompressing stuff that probably doesn't contain an image anyway.
Should the file name only be used to speed up loader search (i.e. eventually relying only on file content) or should the file name have some significance?
Maybe add an option to select "naming strictness"? ... Maybe some day :)

Btw., phab (this site) is going away at some point, business continuing here, I believe: https://git.enlightenment.org/old/legacy-imlib2/issues

NRK added a comment.Sun, May 8, 11:33 AM
In T9008#156683, @kwo wrote:

Should the file name only be used to speed up loader search (i.e. eventually relying only on file content) or should the file name have some significance?
Maybe add an option to select "naming strictness"? ... Maybe some day :)

"Mis-extension-ed" images should always work IMO. So pic.png being named as pic.webp or vice versa.
But for the archive loaders, it makes sense not to waste time decompressing the file.
I only opened the issue because I wasn't sure if it was intended or not, since Mis-extension-ed images works fine.

Btw., phab (this site) is going away at some point, business continuing here, I believe: https://git.enlightenment.org/old/legacy-imlib2/issues

Yes, I noticed that yesterday when trying to do a git pull.
Think I managed to score the first opened issue achievement :)
https://git.enlightenment.org/enlightenment/rage/issues/1

NRK closed this task as Resolved.Sun, May 8, 11:34 AM