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, January 11, 2010 6:35:15 PM(UTC)
Simon2009

Groups: Registered
Posts: 10


The file size seems to get bigger and bigger on subsequent saves. My action are as follows:

'Load image
Set LoadedImage = codecs.Load_10(mvarImage, ImageInfo.BitsPerPixel, CodecsLoadByteOrder_BgrOrGray, 1, 1)

'do some processing like flip image, then save
codecs.Save_4 RasterImageViewer1.Image, mvarImage, ImageInfo.Format, ImageInfo.BitsPerPixel, 1, 1, 1, CodecsSavePageMode_Replace

The file size seems to increase by a single page size each time this operation is done. Any ideas?

 

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, January 12, 2010 3:36:32 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,028

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

The CodecsSavePageMode.Replace does not actually replace the specified page. The index will just point to the new page instead of the old page. Therefore, the file size will grow for each page "replaced" because the page being "replaced" is not deleted.
If you are dealing with TIF file format, you can use the RasterCodecs.CompactFile method.
For more information, please check our .NET help file.

If you are using other file formats, and you want to save a one page file, use the Overwrite flag.
If you want to save a multipage file, load all the files and save them to a new file.
 
#3 Posted : Sunday, January 17, 2010 9:50:37 PM(UTC)
Simon2009

Groups: Registered
Posts: 10


Thanks. This feature seems to work for most of my TIFF files but sometimes I get the attached error. Any ideas?

BTW, the ActiveX object does not have the CompactFile method. How to do it there?

Simon2009 attached the following image(s):
compactfile.gif
 
#4 Posted : Monday, January 18, 2010 3:21:33 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,028

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

When exactly do you face this error? Can you specify which function/method produces this error?
Also, does this happen with all files or only specific ones? If this issue is specific to some files, please send me a small sample file in a ZIP or RAR file.
You can either post it here or send it to support@leadtools.com and mention this post.
When attaching to the forums, do not use the "Preview" feature.

Regarding the CompactFile method, you need to define a raster codecs variable such as:
Dim codecs As RasterCodecs
And then use this variable for the CompactFile method such as:
codecs.CompactFile_2 "c:\test.tif", "c:\test2.tif", 0
 
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.124 seconds.