Invalid image in Lister - can't use Binary and Hex view

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Invalid image in Lister - can't use Binary and Hex view

Post by *MarcinW »

Tested with 8.01 32-bit.

Steps to reproduce:
1) take any file, that is NOT a valid image,
2) change extension to .gif, .jpg or .png,
3) open file in Lister by pressing F3,
4) now we can see empty Lister window,
5) press 2 (or use Options -> Binary) or 3 (or use Options -> Hex),
6) nothing happened.

Interestingly, .bmp extension is an exception. Lister immediately detects that there is no valid image in the file and displays this file as text. And Binary and Hex options work properly. Other extensions should behave in the same way.

Regards
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

Confirmed!
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Confirmed too.

It is pure lister (no plugin).
Pressing 1 shows text though.
Any further press of 2 or 3 is caught correctly afterwards.
#5767 Personal license
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, folks.

Can confirm the reported behaviour.
Can confirm that pressing 1 (text only) and 2 (binary) or 3 (hex) next makes binary view and hex view function properly again.
This is true even if you do use a lister plugin for image files like e.g. Imagine.

Kind regards,
Karl
--
Total Commander v8.01 32-bit under Wine 1.4 on Linux Mint 13 xfce 32-bit.
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

But who has files named as images which are not images ?
I never had such problem and I guess I'll never have it.
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hm, Horst.Epp.

Should I assume that renaming a .gz archive file to .jpg and .png in order to reproduce the reported behaviour was a foolish idea? :wink:
Honestly, the reported problem is not a serious flaw and can be worked around easily.
Yet, maybe the root cause can be fixed without investing too much time, maybe ...

Cheers,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Horst.Epp wrote:But who has files named as images which are not images ? I never had such problem and I guess I'll never have it.
1) This problem may appear with an image file that has been corrupted.

2) Installer of a popular trading platform, MT4 (Meta Trader 4), downloads some files to the "All Users\Application Data\MetaQuotes\WebInstall" folder. There are "mt4clw.png" and "mt4clwdata.png" files there - but they aren't images, they are ZIP archives. I suppose that the purpose is to avoid some problems with antivirus scanners.

Regards
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Now, in 8.50 beta 1, it is better - 2 and 3 keys work properly.

However, it can still be improved - TC should detect, that the image is invalid, and should automatically change Lister mode from 4 ("Image/Multimedia") to 2 ("Binary fixed line length") - in fact, currently Lister does this for invalid images with BMP extension. For other extensions (PNG, JPG...) we can currently observe the following situation:

1) we have files in some directory: VALID.jpg and INVALID.jpg,
2) we select VALID.jpg and press Ctrl+Q - so we can see the image preview in the second panel,
3) now we select INVALID.jpg - the image preview in the second panel doesn't change and still shows previous image; this is because nothing has been drawn. So TC should detect that nothing has been drawn, and in this case should switch to "Binary fixed line length" mode.

Regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for confirming the fix! I prefer to leave it as it is for now.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

OK. But is there any problem with receiving information that the PNG/JPG/etc. is invalid? (I assume that TC handles BMP files using standard Windows APIs, so it receives info about invalid bitmap immediately and switches to text mode; I also assume that for other images TC uses some kind of third party code, and this is the reason why TC may not receive notifications about invalid images...).
Post Reply