IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Page 2 of 2 < 1 2
Topic Options
#48904 - 08/05/14 11:25 AM Re: Image extraction from a file? [Re: ppuserd]
Chris S. Offline
OL Newbie

Registered: 09/22/11
Posts: 16
Your answer is about as I expected, but I thought I would ask here of all the much more knowledgeable PPS minds. They are valid tiffs, I used Notepad+ to trim everything past the first image, then clipped the first 44 characters, and ended up with a valid image.

As far as getting the company providing the data, they have been less than helpful in providing any information about what other companies do in making these type of statements, so I'm doubtful they will change just for me. It looks like, barring additional information from them, that I will whip a script up that will split these apart and name them usefully to work from the XML.

Thanks for your help!

Top
#48905 - 08/05/14 11:31 AM Re: Image extraction from a file? [Re: Chris S.]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Hi Chris,

I've tried downloading the .xml files form your dropbox, but I've looked at them, and I can't seem to see the garbled data that you're talking about. One xml contains a link to an image, the other contains references to fields, not the actual data.

Am I missing anything?

Top
#48906 - 08/05/14 11:33 AM Re: Image extraction from a file? [Re: Chris S.]
ppuserd Offline
OL Guru

Registered: 07/03/12
Posts: 106
can you explain in more depth? so we take off the first 44 chars, and how do you know when the image ends?

i can see that the xml includes an image number, and find that within the file as well.

if you tell me how you do it manually then i'm pretty sure a script can do the same..

Top
#48911 - 08/05/14 05:45 PM Re: Image extraction from a file? [Re: Chris S.]
Chris S. Offline
OL Newbie

Registered: 09/22/11
Posts: 16
I had missed this myself previously, but the XML actually contains the start point and character counts of the image within the blob.

Code:
ImgFrntOff	Numeric	Starting position of front image.
ImgFrntLen	Numeric	Length of front image.
ImgBackOff	Numeric	Starting position of back image.
ImgBackLen	Numeric	Length of back image.


Quote:
• ImgFrntOff
Front OFFSET starts at the beginning of the image header.
• ImgFrntLen
Front length is the actual length of the image starting at the beginning of the front image. Does not include the header length.
• ImgBackOff
Back OFFSET starts at the next position following the end of the front image.
• ImgBackLen
Back length is the actual length of the back image.


So it actually looks a little easier, scripting-wise, than I had previously thought, although it would still be nice if it could all be done within PPS.


--Raphael--
I think you are missing what has been said....
The .img file is a group of tiffs that have been placed all together within 1 file and having header information specific to each tiff. The XML does *not* contain the actual tiff. The XML DOES refer to the file, and the location of the image within the .img file.

Top
#48914 - 08/06/14 09:30 AM Re: Image extraction from a file? [Re: Chris S.]
ppuserd Offline
OL Guru

Registered: 07/03/12
Posts: 106
i was going to ask you what the other nodes were for. but with that info it is indeed 'easy' to solve. though i don't see PPS ever supporting such a file format(s), even why it should.

the extension .img historically has to do with floppy disks, now CD images and i guess this format was just made up for a particular custom/ proprietary application.

it would have far been better if the creators had opted to create multi-page tiffs, and simply referenced a particular page number within the xml instead of all those instructions, what were they thinking??

anyway, at least you now know exactly what to do, that makes me happy smile






Top
Page 2 of 2 < 1 2