A Photography forum. PhotoBanter.com

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PhotoBanter.com forum » Digital Photography » Digital Photography
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Modify jpg DPI info without recompress?



 
 
Thread Tools Display Modes
  #1  
Old October 14th 04, 04:28 PM
Judson McClendon
external usenet poster
 
Posts: n/a
Default Modify jpg DPI info without recompress?

I have JPG images produced by a camera that malfunctioned and wrote bad
DPI info (eg. horizontal vertical), and I would like to be able to change
the DPI info in the JPGs without recompressing. I would write a program to
do it, but I don't know how to locate the DPI info in the JPG files. Can anyone
point me to a free program that does this, or to a format description of JPG
files so that I can write one myself? If I do write one, I'll be happy to make it
available for free download, if anyone is interested.

Thanks!
--
Judson McClendon (remove zero)
Sun Valley Systems
http://sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."


  #2  
Old October 14th 04, 08:07 PM
Toke Eskildsen
external usenet poster
 
Posts: n/a
Default

Jim Townsend wrote

In a JPEG file, the DPI setting is nothing but 5 bytes at the
beginning of the image data.


[Snip Long explanation and sample code]

That works for JFIF, but some (most, maybe? I don't know) digicams does
not add the JFIF block and instead uses EXIF. It's a lot more tricky to
tamper with the EXIF block.

I use dEXIF (Pascal only). I'm sure that there's freely available code
for other languages too.

Since you can always override the DPI settings at the time of
printing, there *really* is no point in changing it.


If the vertical DPI is different from the horizontal, maybe some
programs will assume that the image has another aspect than the one
corresponding to the size in pixels?
  #3  
Old October 14th 04, 08:07 PM
Toke Eskildsen
external usenet poster
 
Posts: n/a
Default

Jim Townsend wrote

In a JPEG file, the DPI setting is nothing but 5 bytes at the
beginning of the image data.


[Snip Long explanation and sample code]

That works for JFIF, but some (most, maybe? I don't know) digicams does
not add the JFIF block and instead uses EXIF. It's a lot more tricky to
tamper with the EXIF block.

I use dEXIF (Pascal only). I'm sure that there's freely available code
for other languages too.

Since you can always override the DPI settings at the time of
printing, there *really* is no point in changing it.


If the vertical DPI is different from the horizontal, maybe some
programs will assume that the image has another aspect than the one
corresponding to the size in pixels?
  #4  
Old October 14th 04, 08:34 PM
Judson McClendon
external usenet poster
 
Posts: n/a
Default

"Jim Townsend" wrote

What do you mean 'bad' dpi info ?



Here is an example of what I mean: The image is 640x480, but the horizontal
DPI is 1626 and the vertical DPI is 1219. This makes the image display/print
distorted. If I 'resize' the image to the same size (640x480) and specify say,
72 DPI, the image looks fine. The only problem is that the editing program
(e.g. Photoshop) recompresses the jpeg. I wanted to avoid the recompress.

Thanks for the info.
--
Judson McClendon (remove zero)
Sun Valley Systems
http://sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."


  #5  
Old October 14th 04, 09:21 PM
RSD99
external usenet poster
 
Posts: n/a
Default

Have you tried IrfanView? You can 'Set' the dpi information
using the 'Information' menu item ... I don't know if it
re-compresses the file when saving it, though.






"Judson McClendon" wrote in message
news:1097782346.EyjA/t3BqJbbO3/[email protected]
"Jim Townsend" wrote

What do you mean 'bad' dpi info ?



Here is an example of what I mean: The image is 640x480,

but the horizontal
DPI is 1626 and the vertical DPI is 1219. This makes the

image display/print
distorted. If I 'resize' the image to the same size

(640x480) and specify say,
72 DPI, the image looks fine. The only problem is that the

editing program
(e.g. Photoshop) recompresses the jpeg. I wanted to avoid

the recompress.

Thanks for the info.
--
Judson McClendon (remove zero)
Sun Valley Systems
http://sunvaley.com
"For God so loved the world that He gave His only begotten

Son, that
whoever believes in Him should not perish but have

everlasting life."




  #6  
Old October 14th 04, 09:21 PM
RSD99
external usenet poster
 
Posts: n/a
Default

Have you tried IrfanView? You can 'Set' the dpi information
using the 'Information' menu item ... I don't know if it
re-compresses the file when saving it, though.






"Judson McClendon" wrote in message
news:1097782346.EyjA/t3BqJbbO3/[email protected]
"Jim Townsend" wrote

What do you mean 'bad' dpi info ?



Here is an example of what I mean: The image is 640x480,

but the horizontal
DPI is 1626 and the vertical DPI is 1219. This makes the

image display/print
distorted. If I 'resize' the image to the same size

(640x480) and specify say,
72 DPI, the image looks fine. The only problem is that the

editing program
(e.g. Photoshop) recompresses the jpeg. I wanted to avoid

the recompress.

Thanks for the info.
--
Judson McClendon (remove zero)
Sun Valley Systems
http://sunvaley.com
"For God so loved the world that He gave His only begotten

Son, that
whoever believes in Him should not perish but have

everlasting life."




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I turn off the info when viewing pics on camera / TV? Nikon coolpics Dirk Digital Photography 7 October 14th 04 10:47 PM
Reading EXIF info with Javascript KS Digital Photography 4 August 3rd 04 05:56 PM
Tri Pod info WMcga66339 Medium Format Photography Equipment 3 July 15th 04 06:04 PM
Info on labs netnews Film & Labs 4 January 14th 04 05:23 PM


All times are GMT +1. The time now is 02:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright 2004-2022 PhotoBanter.com.
The comments are property of their posters.