PIL.Image.frombuffer/string ... who do data using?

I

ivan.dm

hello again everyone!

I'm writing a wrapper for tif file that parse its and return the data
image in this way below :

self.fp.seek(StripOffsets)
data = self.fp.read(StripByteCounts)
return data

where:
self.fp is a file object
StripOffsets is a offset position of image
StripByCounts is extend of image

after we get a data, now to set its in PIL.Image.fromstring(...)
but ( evely! :) ), returned this error follow:

ValueError
"not enough image data"

why???

Should I to convert data in other format???

any suggestion?

Thanks and regard.

Ivan
 
P

Peter Hansen

ivan.dm said:
I'm writing a wrapper for tif file that parse its and return the data
image in this way below :

self.fp.seek(StripOffsets)
data = self.fp.read(StripByteCounts)
return data ....
after we get a data, now to set its in PIL.Image.fromstring(...)
but ( evely! :) ), returned this error follow:

ValueError
"not enough image data"

Why are you doing it this way instead of just using Image.open()? PIL
already knows how to read and convert TIFF images...

-Peter
 
I

ivan.dm

Peter Hansen ha scritto:
Why are you doing it this way instead of just using Image.open()? PIL
already knows how to read and convert TIFF images...

-Peter
yes! for all format it can decode, except for compression G3/G4.
I'm searching a method for decode this compression format

Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top