IPTC Reading/Parsing Problem/Bug in SDK and XNView

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
MaierMan
Posts: 78
Joined: Wed Aug 04, 2004 8:32 pm
Contact:

IPTC Reading/Parsing Problem/Bug in SDK and XNView

Post by MaierMan »

Hi again.

I found out that libgfl (and XNView) often do not process IPTC "correctly", while other programs (tested eg. with IrfanView) do.
I furthermore was able to read it using my own code.

Dont know it it is a bug or simply too "strict" parse-code...
Result is always that the gfl-functions return: No IPTC data found.

Here is the APP13 block of a jpeg where I encountered this behaviour.
http://celebnamer.celebworld.ws/xnview/APP13.bin
Im sorry, but I cannot post the whole image due to legal reasons ;)

My parse tree (which I got from my own parse-code):
http://celebnamer.celebworld.ws/xnview/tree.txt

Just wanted to file this report and let you know about ...

I thought its maybe related to other implementations I saw when I did the research for my own code.
PHP eg. has the following header string in ext/standard/iptc.c (but doesnt check it when simply parsing a block):

Code: Select all

static char psheader[] = "\xFF\xED\0\0Photoshop 3.0\08BIM\x04\x04\0\0\0\0";
But as you can see from my attached block above there is simply no \0\0 padding in front of the Photoshop String...

Im not sure if I remember it right, but was there another length desciptor behind that header? Think I read something about.
This might be another problem and furthermore checking this isnt really necessary if you parse by checking of 0x1C markers.

Cheers Nils

BTW: Do you have a good link for IPTC section meanings (like 2#120 is Caption)?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: IPTC Reading/Parsing Problem/Bug in SDK and XNView

Post by xnview »

MaierMan wrote:I thought its maybe related to other implementations I saw when I did the research for my own code.
PHP eg. has the following header string in ext/standard/iptc.c (but doesnt check it when simply parsing a block):

Code: Select all

static char psheader[] = "\xFF\xED\0\0Photoshop 3.0\08BIM\x04\x04\0\0\0\0";
But as you can see from my attached block above there is simply no \0\0 padding in front of the Photoshop String...
I don't understand, you have only

Code: Select all

\xFF\xEDPhotoshop 3.0\08BIM\x04\x04\0\0\0\0
??
Pierre.
MaierMan
Posts: 78
Joined: Wed Aug 04, 2004 8:32 pm
Contact:

Re: IPTC Reading/Parsing Problem/Bug in SDK and XNView

Post by MaierMan »

References:
http://celebnamer.celebworld.ws/xnview/APP13.bin
binary block extracted from the example file containing all APP13 data.
http://celebnamer.celebworld.ws/xnview/tree.txt
Output from my own parse-code.

[NEW] http://celebnamer.celebworld.ws/xnview/example.jpg
The example.jpg

That was not the reason for this thread. ;)
Im unable to process a range of jpegs containing IPTC-Metadata.
Many of them are from different press-agencies. (what doesnt mean that I have relations with them).

The point is:
XNView and GflSDK doesnt always process this information although it shows to me as a valid IPTC section.
(all contained within the APP13 Section of the jpeg which is the default IPTC Section I think)
Many files work properly with XNView/GflSDK while quite a few others dont.

Other programs like Irfanview or Photoshop or the php-functions do not fail to process the same files.

I wanted to address this issue and give a small conclusion (or better a "maybe") about its reasons:
That your parse-code might be too strict (maybe in the context of the header was my assumption).

Furthermore I just wanted to give an impression about other implementations.
Thought maybe its some kind of related. But its only some "extra information".
The \0\0 "padding" I was meantioning was quite misleading (looks like it was misleading myself too). Sorry about it.

I got the block I posted above (the .bin file).
Also uploaded the example.jpg I took for the deeper "research". s.a.
(A copyrighted one, so I recommend not to mess with it).

There is only the usual marker code before:

Code: Select all

"\xFF\xED\x03\x24" followed by "Photoshop 3.0" etc.
Means the marker \xED (APP13) then the WORD for the section length:
Big Endian(?) value of 804.

This block is followed by the next marker:

Code: Select all

"\xFF\xEE" etc.
I hope I addressed this issue properly now.
Im a bad reporter I know.... Many language barriers, many bad expressions etc... Sorry about it.
All I really wanted it to make you aware of it so that you can have a look after it (if you got some time for it only).

Cheers, and thanks again for the lib.
Nils
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: IPTC Reading/Parsing Problem/Bug in SDK and XNView

Post by xnview »

MaierMan wrote:References:
http://celebnamer.celebworld.ws/xnview/APP13.bin
binary block extracted from the example file containing all APP13 data.
http://celebnamer.celebworld.ws/xnview/tree.txt
Output from my own parse-code.

[NEW] http://celebnamer.celebworld.ws/xnview/example.jpg
The example.jpg
Ok, thanks i check...
Pierre.
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France
Contact:

Post by Ithier »

Hi,

I think that have a problem in connection with MaierMan problem. When I add IPTC data to an image, I cannot see the data in all the applications that I use. I have added data in the folowing fields: Caption, Source, Country, City, ByLine, Date Created, Keywords, supplemental categories.

Here are the results with some applications:

XNview: OK (can we expect less !!)
PixVue: OK
IfranView: only the Caption field is visible
Imagine (lister plugin for TotalCommander): Cannot find any iptc data
PhotoShop 7.0: Error message "Cannot open the file because the file is not compatible with this verion of photoshop."

Any idea ?

Ithier

PS: I will send you the image by private mail.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Ithier wrote:Hi,

I think that have a problem in connection with MaierMan problem. When I add IPTC data to an image, I cannot see the data in all the applications that I use. I have added data in the folowing fields: Caption, Source, Country, City, ByLine, Date Created, Keywords, supplemental categories.

Here are the results with some applications:

XNview: OK (can we expect less !!)
PixVue: OK
IfranView: only the Caption field is visible
Imagine (lister plugin for TotalCommander): Cannot find any iptc data
PhotoShop 7.0: Error message "Cannot open the file because the file is not compatible with this verion of photoshop."

Any idea ?

Ithier

PS: I will send you the image by private mail.
Ok, currently a known issue
Pierre.
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France
Contact:

Post by Ithier »

Hi Pierre,

I know you are very busy with new version of XNView, but when can we expect a new version of SDK with this problem corrected.

Best regards

Ithier
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Ithier wrote:I know you are very busy with new version of XNView, but when can we expect a new version of SDK with this problem corrected.
I'll update the SDK in 1 month i think. Could you send a PM, i'll send a beta version...
Pierre.
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France
Contact:

Post by Ithier »

Thank you Pierre :D

I have tested the new beta version (2.52) and the Photshop problem with IPTC is gone.
IrfanView continue to exibit the same problem but, as it works fine with 3 others software, I think it is more an irfanview problem than a xnview problem.

Ithier
Post Reply