realbasic-nug
[Top] [All Lists]

Re: Getting image data

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Getting image data
From: Joe Strout <joe@inspiringapps.com>
Date: Tue, 31 Mar 2009 08:35:51 -0600
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: <3753b0ed0903310421h6e2ea82dg8e21f6d054e123d3@mail.gmail.com>
Organization: Inspiring Applications, Inc.
References: <3753b0ed0903310421h6e2ea82dg8e21f6d054e123d3@mail.gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
The Green Tea Leaf wrote:

If I have the URL for an image and want to get the height/width of the
image, what is the best way to do it?
Is it to download the image using HTTPSocket.get and then use the Picture
class to get the actual height/width?

Well, this depends on your definition of "best." The procedure you describe is almost certainly best in terms of ease and reliability, since it will work for any image format your OS knows how to interpret. It's probably not best in terms of efficiency, though. If you know your images will be large and of a specific format, then you might want to download just the first so-many bytes and parse the image header to get the size.

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>


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