PhotoBanter.com

PhotoBanter.com (http://www.photobanter.com/index.php)
-   Digital Photography (http://www.photobanter.com/forumdisplay.php?f=5)
-   -   Modify jpg DPI info without recompress? (http://www.photobanter.com/showthread.php?t=15634)

Judson McClendon October 14th 04 04:28 PM

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."



Toke Eskildsen October 14th 04 08:07 PM

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?

Toke Eskildsen October 14th 04 08:07 PM

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?

Judson McClendon October 14th 04 08:34 PM

"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."



RSD99 October 14th 04 09:21 PM

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/rRI8A1Q@teranews...
"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."





RSD99 October 14th 04 09:21 PM

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/rRI8A1Q@teranews...
"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."






All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
PhotoBanter.com