realbasic-nug
[Top] [All Lists]

Re: Getting image data

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Getting image data
From: Paul Raulerson <paul.raulerson@mac.com>
Date: Tue, 31 Mar 2009 21:23:02 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <49D257D6.5020307@inspiringapps.com>
References: <3753b0ed0903310421h6e2ea82dg8e21f6d054e123d3@mail.gmail.com> <49D22A47.608@inspiringapps.com> <3753b0ed0903310747n228c7763j33890fc403829be6@mail.gmail.com> <55534378039663975067776974302513501206-Webmail@me.com> <3753b0ed0903310937k7e79084by5f9e777ffef381d@mail.gmail.com> <22102D0B-170C-4E67-9F92-AA4B56DCD631@tolisgroup.com> <49D257D6.5020307@inspiringapps.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
How are you going to use them? You are either going to read the entire image into a memory cache, or else inot a disk file. Also, I'm not convinced that JPEG images always report the correct real size.

Besides, as far as I know, none of the JPEG standard formats (JFIF, EXIF, etc) report the size of the image in the image data.
Are you sure you are thinking of JPEG encoded image files?

JPEG formats follow this pattern:

SOI
SOF0
SOF2
DHT
DQT
DRI
SOS
RSTn
APPn <---- maybe size is in here, but this is application dependent, and also near the end of the image!
COM
EOI

-Paul



On Mar 31, 2009, at 12:50 PM, Joe Strout wrote:

Tim Jones wrote:

The images (always jpegs) are available on a web site.
Yes, but to use them, you need to copy the (at least temporarily) to the local system. You can then access them to determine the properties. So in that case, they become disk files.

But there's no need for that. Open a socket, get the first few bytes (for suitable values of "few"), and parse them to obtain the desired information (image width and height). It seems very wasteful to involve the disk here.

Best,
- Joe

--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>