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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
"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
|
|||
|
|||
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." |
#6
|
|||
|
|||
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." |
Thread Tools | |
Display Modes | |
|
|
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 04:23 PM |