Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Image size JPEG

128 views
Skip to first unread message

Harry Schurink

unread,
Feb 16, 2004, 6:31:30 AM2/16/04
to
Hello,

Can anyone give me pointers on how i can determine the width and height of a
JPEG image?
Loading the image is not an option.
I have found a lot of scripts how to extract this info from a JPEG, but they
are all tediously slow.

There must be a faster way to find these "magic numbers" because when i put
the cursor over a jpg-filename in the explorer, the popup text immediately
tells me its 1600x1200
The fastest powerbuilder-script/exampes I have found take bout 5 seconds on
a 2ghz P4
(including the one i have written myself a couple of years ago).

Please
Anyone?

Grtz
harry

JHP

unread,
Feb 16, 2004, 9:50:51 AM2/16/04
to
Not sure if this will help:

I set an invisible picture object on my window and in a button clicked event
I coded the following:

Int li_width, li_height

p_1.PictureName = "C:\Graphics\cloud.jpg"
p_1.OriginalSize = True
li_width = UnitsToPixels(p_1.Width, XUnitsToPixels!)
li_height = UnitsToPixels(p_1.Width, YUnitsToPixels!)
MessageBox(String(li_width), li_height)

HTH

"Harry Schurink" <h_schurinkATtsdDOTnl> wrote in message
news:4030aa12$1@forums-1-dub...

Roy Kiesler [TeamSybase]

unread,
Feb 16, 2004, 2:50:37 PM2/16/04
to
Take a look at
http://www.teamsybase.com/roy.kiesler/downloads/imageutils.zip

Note: the demo still has a small issue with JPEG images that contain a
thumbnail as part of the header -- in that case, the size returned is that
of the thumbnail, not the full-size image. I haven't had the time to drill
this one down -- maybe you will...

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com

"Harry Schurink" <h_schurinkATtsdDOTnl> wrote in message
news:4030aa12$1@forums-1-dub...

Gerald F. Whitmarsh

unread,
Feb 16, 2004, 3:25:12 PM2/16/04
to
I used to have that problem. The locations of the dimensions seemed to
vary with the type of JPG-scanned, camera etc. I then purchased a
brilliant library - ImgSource from
http://www.smalleranimals.com/isource.htm.
Never looked back.

HTH
Gerry


On 16 Feb 2004 03:31:30 -0800, "Harry Schurink" <h_schurinkATtsdDOTnl>
wrote:

Harry Schurink

unread,
Feb 17, 2004, 6:02:40 AM2/17/04
to
Hi Roy,

I know your library, but that has the same performance issues as the sources
that i have,
(downloaded it yesterday before posting this message)

Investigation shows that you used the same original perl-source that i used.
So its slow too...

There must be a way to find those properties quicker...

Anyone?


"Roy Kiesler [TeamSybase]" <SPAM_FREE_...@teamsybase.com> schreef in
bericht news:403121ad$1@forums-2-dub...

Roy Kiesler [TeamSybase]

unread,
Feb 17, 2004, 8:12:09 PM2/17/04
to
C++? Tyler has a project on CodeXchange that's a wrapper for some
open-source imaging product -- perhaps that will do...

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com


--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com

"Harry Schurink" <h_schurinkATtsdDOTnl> wrote in message

news:4031f774$1@forums-2-dub...

0 new messages