473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Jan 8 '06 #1
2 5386
ivan.dm wrote:
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

Jan 9 '06 #2
Peter Hansen ha scritto:
ivan.dm wrote:
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

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

Ivan
Jan 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
3
by: dale zhang | last post by:
Hi, I am trying to read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp The article author is using PictureBox for windows...
1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
5
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
8
by: jbrewer | last post by:
I'm trying to read in a FITs image file for my research, and I decided that writing a file decoder for the Python imaging library would be the easiest way to accomplish this for my needs. FITs is...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
0
by: Gary Herron | last post by:
Marlin Rowley wrote: Numpy can do this for you. First, do you really mean the array to contain lists of one string each? If so: kludge here array(, dtype='|S1') array(, ,
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.