LEADTOOLS Support
Imaging
Imaging SDK Questions
BitmapXres / BitmapYres does not return correct DPI on large files
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, April 6, 2006 2:45:58 PM(UTC)
Groups: Registered
Posts: 2
I'm trying to resize an image to a standard photo size. When the image size is not too big (less than 2000kB), the BitmapXres / BitmapYRes returns the correct DPI so I end up with the correct size and resolution.
However, when the file is large (say more than 4500kB), the BitmapXres / BitmapYres return 72 - which is the default DPI. My picture ends up to be very fuzzy since the original DPI was 300.
Does anyone know how to solve this ?
This is my code snippet:
lQuality = GetCompressionQuality(g_oAppSettings.CompressionQuality)
Lead1.Load sOriginalFile, 0, 0, 1
If bResize Then
If ParseImageSize(lHeight, lWidth, g_oAppSettings.ImageSize) Then
'convert to pixels
lWidth = lWidth * Lead1.BitmapXRes
lHeight = lHeight * Lead1.BitmapYRes
Lead1.Size lWidth, lHeight, RESIZE_FAVORBLACK_OR_BICUBIC
End If
End If
Thanks !!!
#2
Posted
:
Monday, April 10, 2006 10:51:35 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
Patricia,
To try to identify the source of image quality loss, it would help if I could get the following from you:
1. A sample source image before resizing.
2. The actual values of lWidth and lHeight you pass to the Size method in your code above.
If you want to post an image here, please put it in a ZIP file first. Alternatively, you could send it to
support@leadtools.comAmin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Wednesday, April 12, 2006 7:09:07 AM(UTC)
Groups: Registered
Posts: 2
1/. Attached is a zip file of the image
2/. lWidth = 6, lHeight = 4 (in inches)
Thank you,
Patricia
#4
Posted
:
Sunday, April 16, 2006 8:51:36 PM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
Patricia,
There doesn't seem to be an attachment with the post. One user in the
past reported losing the attachment when using the 'Preview' button,
which might be what happened to you.
Could you please post the ZIP attachment again or send it to
support@LEADTOOLS.com?
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
#5
Posted
:
Thursday, April 20, 2006 4:33:32 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello Patricia,
I received your image that you sent to our support department and checked it. I noticed the following:
The file contains the following exif tags:
XResolutin (tag code = 0x011A), value = 0x48/0x01, which is 72
YResolutin (tag code = 0x011B), value = 0x48/0x01, which is 72
This means if any program opens it and does not read the correct tag value, it's a problem in that program.
Other than LEADTOOLS, I checked using Adobe Photoshop and it reads the correct values of 72DPI also.
Please keep me up to date of the status of this issue on your end.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
Imaging
Imaging SDK Questions
BitmapXres / BitmapYres does not return correct DPI on large files
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.