| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2006.08.29 14:02 "Re: How to find/read resolution values", by Muthu KumarYes, after changing into proper data type (float, uint16, uint32) for the variables, now I can read/write the proper values. After your mail i saw this site and it gives the proper data type for the variables. http://www.devdaily.com/unix/man/man3/TIFFGetField.3t.shtml Thank you very much. -- Muthukumar. J --- Toby Thain <toby@smartgames.ca> wrote: > > On 25-Aug-06, at 1:40 AM, muthu kumar wrote: > > > Dear Friends, > > > > I am new to Tiff file processing. > > I can read the tiff file and i used the functions > to > > assign the resolution of the image as follows, > > > > uint32 w,h,bpp, xres=0, yres=0, resunit=2; > > > > > TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,(uint16)resunit); > > > TIFFSetField(tiff,TIFFTAG_XRESOLUTION,(float)xres); > > > TIFFSetField(tiff,TIFFTAG_YRESOLUTION,(float)yres); > > > > and it works well. But when i tried to read the > > resolution using the functions > > > > uint32 w,h,bpp,xres=0, yres=0, resunit=0; > > > > TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &xres); > > TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &yres); > > TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, > &resunit); > > > > I got the results like > > xres = 0x42900000 or xres = 0x43960000 > > > > I know that the > > xres = 0x42900000 for dpi = 72 > > and xres = 0x43960000 for dpi = 300 > > > > But I want to know how to calculate the dpi values > > from this hex values. Is there any fomula for > this. > > Or the function i am using is wrong. > > If xres and yres are defined as 'float' type, you > should see what you > expect. > > --Toby > > > > > Please help. > > > > Thankyou. > > > > Muthu.J > > muthupyr@yahoo.com > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Tiff mailing list: Tiff@lists.maptools.org > > http://lists.maptools.org/mailman/listinfo/tiff > > http://www.remotesensing.org/libtiff/ > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|||||||