Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

TifJpeg Compression--resolution change
Started by aaron_dan at 11-12-2007 18:33. Topic has 6 replies.

Print Search « Previous Thread Next Thread »
  11-12-2007, 18:33
aaron_dan is not online. Last active: 9/16/2008 3:49:17 PM aaron_dan

Not Ranked
Joined on 03-30-2007
Posts 6
TifJpeg Compression--resolution change
Reply Quote

I am using Leadtools v15.  Programming in C#, .Net 2.0.  I'm opening some images (saved as TifJpeg), doing some manipulation, and resaving them in the same (hopefully) format.  The problem is that the images are not saved back to the original resolution and compression.  I've taken out all of the code that does any kind of manipulation so that I simply open the file and resave it and it still changes things.  The size in bytes is changed and also (according to IrfanView) the resolution and size in cm is changed.  I've pasted the code snippet below.  There really isn't much to it.  If I save it uncompressed (Tif) then it turns out fine, but is obviously much larger as well.  Is there something simple (like setting the Save options) that I'm missing?  Also, one of the requirements of the viewing software (3rd party) that we are using is that the horizontal and vertical resolution settings of the image be identical and this is not being maintained when I save the file.

Thanks,

Aaron

*****************************************************************************

            Leadtools.Codecs.RasterCodecs codecs = null;
            Leadtools.RasterImage image = null;

            try
            {
                codecs = new Leadtools.Codecs.RasterCodecs();
                image = new Leadtools.RasterImage(codecs.Load(acFileName));
                codecs.Save(image, acFileName, Leadtools.RasterImageFormat.TifJpeg, 0);

               .......

               }

***************************************************


   Report 
  11-13-2007, 10:10
Adnan Ismail is not online. Last active: 10/7/2008 3:40:32 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,214
Re: TifJpeg Compression--resolution change
Reply Quote
Can you try to generate this behavior using our Main C# Demo shipped with the toolkit? Do you get the same result when saving the image in the same format and compression? If yes, please send me a sample image that you tested and tell me what build number (version info) of LEADTOOLS DLLs you have.

If you want to send the file, please put it in a ZIP or RAR file.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-13-2007, 11:36
aaron_dan is not online. Last active: 9/16/2008 3:49:17 PM aaron_dan

Not Ranked
Joined on 03-30-2007
Posts 6
Re: TifJpeg Compression--resolution change

Attachment: sample.zip
Reply Quote

Yes, I can dupe this using the Main C# Demo, though perhaps I am doing it wrong.  I tried saving it as a .tif in all the varitions and (other than uncompressed) I always got something out that is different from the original.  The version number is 15.0.0.1

Thanks for your help.


   Report 
  11-14-2007, 8:54
Adnan Ismail is not online. Last active: 10/7/2008 3:40:32 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,214
Re: TifJpeg Compression--resolution change
Reply Quote
I tried to save the TIFF image you sent me using the demo and did not face a problem. I managed to save the file in the same format, compression and resolution. Please note that I am using the latest build of LEADTOOLS v15 DLLs.

you can obtain the latest build of LEADTOOLS v15 DLLs by downloading and installing the latest toolkit setup from our site.

If you face a problem downloading the setup, please send and email to support@leadtools.com and mention this post
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-14-2007, 18:16
aaron_dan is not online. Last active: 9/16/2008 3:49:17 PM aaron_dan

Not Ranked
Joined on 03-30-2007
Posts 6
Re: TifJpeg Compression--resolution change
Reply Quote

Thanks Adnan.  That fixed the problem and actually the latest API has a lot more to it as well, so I'm happy about that.

I do have one other related question now though:

I want the resultant image to be the same compression as the original.  I can do this using the main demo by manually setting the Quality Factor setting.  I can see where to set this in the code for the image before saving it, but where do I read it in from?  Is there a way to do get this from the original file?


   Report 
  11-15-2007, 11:46
Adnan Ismail is not online. Last active: 10/7/2008 3:40:32 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,214
Re: TifJpeg Compression--resolution change
Reply Quote
Please check the following forum post that discusses this issue:
http://support.leadtools.com/SupportPortal/cs/forums/8253/ShowPost.aspx#8253
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  11-15-2007, 12:54
aaron_dan is not online. Last active: 9/16/2008 3:49:17 PM aaron_dan

Not Ranked
Joined on 03-30-2007
Posts 6
Re: TifJpeg Compression--resolution change
Reply Quote

Good to know.  Thanks.


   Report 
Post
LEAD Support Fo... » Developer » Image Compressi... » TifJpeg Compression--resolution change

Powered by Community Server, by Telligent Systems