Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, November 12, 2007 1:28:33 PM(UTC)
aaron_dan

Groups: Registered
Posts: 6


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);

               .......

               }

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

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, November 13, 2007 5:05:24 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)

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.
 
#3 Posted : Tuesday, November 13, 2007 6:31:40 AM(UTC)
aaron_dan

Groups: Registered
Posts: 6


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.

File Attachment(s):
sample.zip (802kb) downloaded 23 time(s).
 
#4 Posted : Wednesday, November 14, 2007 3:49:00 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)

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
 
#5 Posted : Wednesday, November 14, 2007 1:11:07 PM(UTC)
aaron_dan

Groups: Registered
Posts: 6


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?

 
#6 Posted : Thursday, November 15, 2007 6:41:19 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)

Please check the following forum post that discusses this issue:
http://support.leadtools.com/SupportPortal/cs/forums/8253/ShowPost.aspx#8253
 
#7 Posted : Thursday, November 15, 2007 7:49:32 AM(UTC)
aaron_dan

Groups: Registered
Posts: 6


Good to know.  Thanks.

 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.079 seconds.