[Tutor] how to read and transmit/send only section of the image (sub-image)

Wayne srilyk at gmail.com
Thu Sep 3 15:50:53 CEST 2009


On Thu, Sep 3, 2009 at 8:05 AM, Jojo Mwebaze <jojo.mwebaze at gmail.com> wrote:

> Hello Tutor
>
> I am writing Class to provide data transfer between the server and client
> processes based on simple HTTP GET/POST operations. However my interest is a
> sub-image (section of a full image). i am requesting help on how to read and
> transmit/send only section of the image (sub-image). i also prefer read the
> bytes (of the subimage) off the disk, without opening the file into memory!
>
> The images i work with are of type FITS.
>

The biggest problem is that image files usually have header information in
the file that tell what the file type is, how big it is, and that sort of
thing. I've never used FITS images though, so I don't know that much about
them.

I'm not sure how the python open works, if it loads the file into memory or
if it just creates a file pointer to the location on disk. AFAIK it's the
latter, in which case opening the file and seeking to the correct place,
reading a specific size, and saving that data would be all you need to do.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090903/662796fb/attachment.htm>


More information about the Tutor mailing list