BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get DPI for a JPEG file ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
yc
Guest





PostPosted: Wed Aug 03, 2005 5:47 am    Post subject: How to get DPI for a JPEG file ? Reply with quote




Hi,
I've been struggling and bogging down nearly for a day unfortunately no good.
Is there a way to get the dpi for a jpeg file ?
There is no help or doc available at Borland site.

Thank in advance
yc
Back to top
Yannis
Guest





PostPosted: Wed Aug 03, 2005 8:37 am    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote



"yc" <yc (AT) yc (DOT) yc> wrote in news:42f05a65$1 (AT) newsgroups (DOT) borland.com:

Quote:

Hi,
I've been struggling and bogging down nearly for a day unfortunately
no good. Is there a way to get the dpi for a jpeg file ?
There is no help or doc available at Borland site.

Thank in advance
yc

for any kind of information from most of the file formats
I always recomend to take a look on
http://www.wotsit.org/
as far as I remember it has at least two documents for jpeg.


regards
Yannis.

Back to top
yc
Guest





PostPosted: Wed Aug 03, 2005 8:58 am    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote




Thanks Yanis,
Quite good site
Yannis <None (AT) noware (DOT) non> wrote:
Quote:
"yc" <yc (AT) yc (DOT) yc> wrote in news:42f05a65$1 (AT) newsgroups (DOT) borland.com:


for any kind of information from most of the file formats
I always recomend to take a look on
http://www.wotsit.org/
as far as I remember it has at least two documents for jpeg.


regards
Yannis.


Back to top
Joris Van Damme
Guest





PostPosted: Wed Aug 03, 2005 11:41 am    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

Quote:
Quite good site

It used to be. But it's so badly maintained last couple of years, that it
hardly deserves us linking to it from our messages anymore... Don't try and
find anything recent there, and do double-check anything you find there
because chances are that it's outdated and overwritten in the maintained
parts of the universe.

Today, wotsit.org mainly serves as a vehicle for the screensaver pop-up and
pop-under advertissements that seems to be so terribly filthy as to even be
able to work around most filth blockers. That's shamefull practice, all by
itself.

Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Jim Slade
Guest





PostPosted: Wed Aug 03, 2005 12:38 pm    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

"yc" <yc (AT) yc (DOT) yc> wrote in news:42f05a65$1 (AT) newsgroups (DOT) borland.com:

Quote:

Hi,
I've been struggling and bogging down nearly for a day unfortunately
no good. Is there a way to get the dpi for a jpeg file ?
There is no help or doc available at Borland site.

This is not defined by the JPEG standard. The location of the information
depends upon the file format being used. JFIF, the most common (search on
that) has provisions for including it but the information is often not
filled in. I can't remember off the top of my head if EXIF, the other
common format (search on tha) has the information. Adobe also has their own
file format.


Back to top
Joris Van Damme
Guest





PostPosted: Wed Aug 03, 2005 1:12 pm    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

Quote:
This is not defined by the JPEG standard. The location of the information
depends upon the file format being used.

Confirmed.

Quote:
JFIF, the most common (search on
that) has provisions for including it but the information is often not
filled in.

Confirmed.

Quote:
I can't remember off the top of my head if EXIF, the other
common format (search on tha) has the information.

Not really, see
http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html. There
is some stuff that is related, but as EXIF is primarilly intended for
documenting photographs and the state of the camera as the photograph is
taken, the notion of normal DPI as in 'how large does this print' does not
make much sense anyhow.

Also, even though the EXIF-in-JPEG and JFIF specification are mutually
exclusive, strictly speaking, it has become common practice to mix the EXIF
info into JFIF files. Thus, even in JPEGs with EXIF, I'd be looking for the
typical JFIF encoded DPI instead.

Quote:
Adobe also has their own
file format.

I thought Adobe did write JFIF-style JPEGs last couple of decades. They had
their own extension in the pre-JFIF days, but I thought they had abandoned
that in favor of JFIF.

What the original poster needs is a JPEG parser for starters. The following
is from the top of my head and may need correction.

JPEG is a stream of marker. Each block starts with a variable number of 255
bytes (mostly just one), followed by a marker ID byte. This marker ID byte
is not 0 and not 255. If the particular marker type identified by this ID
byte has a 'data segment', the next two bytes encode the length of this data
segment, the two bytes included, and next comes the data. After that, next
marker should start, etc.

The actual compressed image data does not comply to the above scheme. If you
parse a JPEG with the above scheme, you'll typically see a large block of
'unmarked' data sitting in between two markers, that's the actual compressed
image data.

From the JFIF spec, which is only a couple of plain text pages, it should be
easy to see what market type you need to find to get at the DPI info.


Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Jim Slade
Guest





PostPosted: Wed Aug 03, 2005 4:08 pm    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

"Joris Van Damme" <PleaseReplyTo (AT) TheGroupInstead (DOT) be> wrote in
news:42f0c2cb (AT) newsgroups (DOT) borland.com:

Quote:
I can't remember off the top of my head if EXIF, the other
common format (search on tha) has the information.

Not really, see
http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html.
There is some stuff that is related, but as EXIF is primarilly
intended for documenting photographs and the state of the camera as
the photograph is taken, the notion of normal DPI as in 'how large
does this print' does not make much sense anyhow.

That was my recollection.

Quote:

I thought Adobe did write JFIF-style JPEGs last couple of decades.
They had their own extension in the pre-JFIF days, but I thought they
had abandoned that in favor of JFIF.

For the most part except for 4-component JPEGs. They do include their own
APPn markers and who knows what goes in them.

Quote:


Back to top
Yannis
Guest





PostPosted: Thu Aug 04, 2005 1:03 pm    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

"Joris Van Damme" <PleaseReplyTo (AT) TheGroupInstead (DOT) be> wrote in
news:42f0ad69 (AT) newsgroups (DOT) borland.com:

Quote:
Quite good site

It used to be. But it's so badly maintained last couple of years, that
it hardly deserves us linking to it from our messages anymore... Don't
try and find anything recent there, and do double-check anything you
find there because chances are that it's outdated and overwritten in
the maintained parts of the universe.

Translation

I used to like it when I started out but now my knownledge on
interested issues to me is bigger and I can find halls in the
site and documentation.

Ok good for you.

Regards
Yannis.

Back to top
Joris Van Damme
Guest





PostPosted: Thu Aug 04, 2005 1:37 pm    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote

Quote:
Translation

Translation? It's OK to say you suspect that might be the reasoning behind
my statement, it's OK to ask me if that is the reasoning behind my
statement. But don't just claim it is, that's not OK.

And it's not correct, either. I had nothing to gain from making that
statement. It was true resentement for bad maintanance, true resentement for
invasive advertising, and a friendly warning to my fellow coders, meant only
to be helpful.

I'm not going to waste another word on this though, reply what you like, and
please ignore any effort of mine to be helpful in the future. Block me, I
will always be posting from the same pseudo-address and with the same footer
signature, so instruct your news client to ignore my posts, please.


Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Yannis
Guest





PostPosted: Fri Aug 05, 2005 6:34 am    Post subject: Re: How to get DPI for a JPEG file ? Reply with quote


I am sorry if I offended you, it wasn't my intention.

Regards
Yannis.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.