Page 1 of 2

b1: Bugs in file recognition config

Posted: Mon Dec 12, 2005 10:18 am
by Xyzzy
Hello!

So we have 2 options for file recognition- Recognize only by extension and Scan file headers in folders.

1. If Recognize only by extension is checked, the files should be recognized only by extension (it's what the option says at least). It is not true :!: since in Details mode, for a JPG renamed to BMP the Type column says JPEG TrueColor. Some header scanning is used and should not.

2. If Recognize only by extension is checked AND Scan file headers is Never, files are not recognized (fe. no info in Type column). They should be, as Recognize only by extension is checked and extensions match file types.

X.

Re: b1: Bugs in file recognition config

Posted: Mon Dec 12, 2005 11:28 am
by xnview
Xyzzy wrote:1. If Recognize only by extension is checked, the files should be recognized only by extension (it's what the option says at least). It is not true :!: since in Details mode, for a JPG renamed to BMP the Type column says JPEG TrueColor. Some header scanning is used and should not.
I confirm
2. If Recognize only by extension is checked AND Scan file headers is Never, files are not recognized (fe. no info in Type column). They should be, as Recognize only by extension is checked and extensions match file types.
Hum no, if scan file headers is never, even if extension is good, the info will not be extracted...

Posted: Mon Dec 12, 2005 12:05 pm
by Xyzzy
Ok, I think I improperly used displaying of file type in Type column as indicator if file is recognized.

Additionaly, I assume that Scan file headers in folders is used for file type recognition.

So, using Use Colour option, file list in List mode:

Recognize... checked, Scan file... Always - JPEG enamed to BMP is coloured like JPEG, and should be like BMP (because it is what Recognize ONLY by extension says). Edit: After deleting .ini and retry, JPEG renamed do BMP is not coloured at all, and should be like BMP.

Recognize... checked, Scan file... Never - files are not coloured, and they should (extensions are OK).

Edit: Cache must be turned off for testing these two!

Another bug I think: in List mode colouring disappears after switching to another directory. To reproduce:
Check Use Colour
Go to directory with images, View as anything but List
Switch to List
Click in tree another directory with images- colouring disappears and should not.

X.

Posted: Mon Dec 12, 2005 1:00 pm
by Xyzzy
I think there is another problem to it:
When playing with recognition settings, very often XnView starts do display image files in external viewer!
After playing a bit more it starts to behave properly again, even when the options are the same.

X.

Posted: Mon Dec 12, 2005 8:05 pm
by xnview
Xyzzy wrote:I think there is another problem to it:
When playing with recognition settings, very often XnView starts do display image files in external viewer!
After playing a bit more it starts to behave properly again, even when the options are the same.
Do you have always the problem, open in external viewer is done by "open action"

Posted: Tue Dec 13, 2005 8:44 am
by Xyzzy
So far I haven't noticed any pattern. When it happens, all methods of opening (Open toolbar button, double-click, RMB->Open) open image in external viewer. I associate the problem with file recognition settings, as I have opening 'Other' files set to external viewer, but as I said, I cannot find any repeatable pattern :(

EDIT: I think marsh writes about it in "b1: Browser to fullscreen stopped working"

X.

Posted: Tue Dec 27, 2005 9:34 am
by Xyzzy
Detailes steps to reproduce.

Directory with JPEG file with extension changed to BMP and another JPEG file, with OK extension.

Deleted INI. Deleted cache contents. Run XnView.

Double click renamed file- displays in external Windows viewer - BAD, it should be opened in Xnview, because BMP should be recognized as image type by extension and action for image files is Open in XnView.
Change to List mode.
Renamed file is not coloured at all- BAD, it should be coloured as BMP file.
Changed Scan file headers to Never. Closed XnView. Deleted cache contents, Started XnView.
Files are not coloured at all- BAD, they should be coloured as BMP and JPEG file, according to 'Recognize only be extension'.
Closed XnView. Deleted INI, Started XnView.
Go to ANY directory with images. Files are coloured OK. Now switch file list to List. Go to another directory with images. Files are not coloured- BAD, they should.

X.

Posted: Wed Dec 28, 2005 9:00 am
by xnview
Xyzzy wrote:Detailes steps to reproduce.

Directory with JPEG file with extension changed to BMP and another JPEG file, with OK extension.

Deleted INI. Deleted cache contents. Run XnView.

Double click renamed file- displays in external Windows viewer - BAD, it should be opened in Xnview, because BMP should be recognized as image type by extension and action for image files is Open in XnView.
Change to List mode.
Renamed file is not coloured at all- BAD, it should be coloured as BMP file.
Changed Scan file headers to Never. Closed XnView. Deleted cache contents, Started XnView.
Files are not coloured at all- BAD, they should be coloured as BMP and JPEG file, according to 'Recognize only be extension'.
No it's normal because this file is not recognized as BMP file!
Closed XnView. Deleted INI, Started XnView.
Go to ANY directory with images. Files are coloured OK. Now switch file list to List. Go to another directory with images. Files are not coloured- BAD, they should.
Normal too, in list mode, i don't check file format.
Keep in mind, that i don't use extension for the color of items..

Posted: Wed Dec 28, 2005 9:46 am
by Xyzzy
xnview wrote:
Xyzzy wrote: Files are not coloured at all- BAD, they should be coloured as BMP and JPEG file, according to 'Recognize only be extension'.
No it's normal because this file is not recognized as BMP file!
No, it's NOT normal. Option says Recognize only by extension. Extension is BMP. So file should be BMP from XnView's point of view. XnView can display error message on display, but coloring should be OK.
xnview wrote: Normal too, in list mode, i don't check file format.
Keep in mind, that i don't use extension for the color of items.
So what do you use for color of items if 'Recognize only by extension' is checked?????

I consider these are bugs, because program does not behave as its options suggest!


So, if we are at this subject, a few questions to you Pierre:
- What does file recognition feature do?
- What and where does 'Recognize only by extension' actually do?
- What and where does 'Scan file headers in folders' actually do?
- What are interactions of 'Recognize only by extension' and 'Scan file headers in folders'? Fe. if 'Scan file headers in folders' is 'Never', files seemingly should be recognized only by extension. So what 'Never' is for?
- What features disregard these options? So far I know one- file colouring. So how file colouring recognizes files?
- Are you sure the names of these options are OK?


X.

Posted: Wed Dec 28, 2005 10:18 am
by xnview
Xyzzy wrote:I consider these are bugs, because program does not behave as its options suggest!
No i don't think that it's bug, only my design
So, if we are at this subject, a few questions to you Pierre:
- What does file recognition feature do?
Read the header to check the format
- What and where does 'Recognize only by extension' actually do?
Used in thumbnail & detail mode, if a file has not the good extension, will be readed correctly
- What and where does 'Scan file headers in folders' actually do?
Used in list & column mode to read header of files
- What are interactions of 'Recognize only by extension' and 'Scan file headers in folders'? Fe. if 'Scan file headers in folders' is 'Never', files seemingly should be recognized only by extension. So what 'Never' is for?
Not used on the same mode
- What features disregard these options? So far I know one- file colouring. So how file colouring recognizes files?
File colouring is used when a file is recognized, not with his extension but the file header.
- Are you sure the names of these options are OK?
Yes :-)

Posted: Wed Dec 28, 2005 10:34 am
by Xyzzy
Oh THANKS, so only 3 questions left:

- Thumbnail mode, bad file extension, Recognize only by extension checked. What happens?
- Thumbnail mode, Recognize only by extension is UNchecked. What else is used for determining file type?
- Thumbnail mode, Recognize by extension checked. Files are coloured. How it is possible? Headers are not scanned in this mode, so colouring should not work.

X.

Posted: Wed Dec 28, 2005 10:44 am
by xnview
Xyzzy wrote: - Thumbnail mode, bad file extension, Recognize only by extension checked. What happens?
The file is not recognize as picture (this is normal)
- Thumbnail mode, Recognize only by extension is UNchecked. What else is used for determining file type?
the header of file (i read the file)
- Thumbnail mode, Recognize by extension checked. Files are coloured. How it is possible? Headers are not scanned in this mode, so colouring should not work.
Headers are scanned because i extract/create the thumbnail

Posted: Wed Dec 28, 2005 1:34 pm
by Xyzzy
Well, so in thumbnail mode files are effectively recognized always also by header, because you read headers when creating thumbnails?

In List and Icons mode, recognition using extension is NOT used at all, right?

X.

Posted: Wed Dec 28, 2005 2:49 pm
by xnview
Xyzzy wrote:Well, so in thumbnail mode files are effectively recognized always also by header, because you read headers when creating thumbnails?
Yes
In List and Icons mode, recognition using extension is NOT used at all, right?
I use only extension (if enabled) too

Posted: Wed Dec 28, 2005 3:18 pm
by Xyzzy
xnview wrote:
Xyzzy wrote:In List and Icons mode, recognition using extension is NOT used at all, right?
I use only extension (if enabled) too
I do not quite follow.
'Scan file headers in folders' is the only option for List and Icons.
If headers are to be scanned, file types are determined by header.
If not, file extension is used for the files that are not scanned?

X.