Article View: borland.public.cppbuilder.multimedia
Article #438Re: JPEG properties
From: Remy Lebeau (TeamB)
Date: Mon, 09 Aug 2004 16:56
Date: Mon, 09 Aug 2004 16:56
35 lines
1868 bytes
1868 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message
news:41175fe0@newsgroups.borland.com...
> Hi all, is there anyway to get the dimensions of a jpeg
> without opening it and loading it into a Bitmap memory block.
TJPEGImage inherits Width and Height properties from TGraphic. You don't
need to convert to TBitmap first:
AnsiString MakeJPEGHtmlWrapper(TStringList * L)
{
//...
TJPEGImage *jpg = new TJPEGImage;
//...
jpg->LoadFromFile(B);
//..
A += ( "width: " + IntToStr(jpg->Width) + "px; height: " +
IntToStr(jpg->Height) + "px; \">" );
//...
delete jpg;
//...
}
> The code snippet here creates a wrapper for jpegs whose
> file names are in a string list, if I have 30 jpegs does it mean
> I load all these jpegs one by one?
Yes.
> Is there a way I can read the header and get the dimensions?
Not unless you open the files yourself and decode the jpeg data manually.
Gambit
Technical Details
Message-ID:
<4117ac8f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<41175fe0@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,6720cf3f1348e602 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.multimedia References: <41175fe0@newsgroups.borland.com> Subject: Re: JPEG properties Date: Mon, 9 Aug 2004 09:56:17 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4117ac8f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092070543 68.69.17.41 (9 Aug 2004 09:55:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail