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 : Wednesday, February 27, 2008 9:58:29 AM(UTC)
kgillispie

Groups: Registered
Posts: 8


After changing a multi page TIFF, deleting a page, the file size grows. I would think the file size would shrink.

Any ideas would be greatly appreciated.

Thanks,
Kreg Gillispie
 

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 : Wednesday, February 27, 2008 10:33:38 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


What is the file version of ltkrn13n.dll?

Please send a before and after of this TIF image.

Please post a code snippet of how you are removing the page from the TIF image.

NOTE: If you are attaching a project or file to the forums...
1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.  If it is larger, please send an email to support@leadtools.com and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
 
If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to support@leadtools.com and make sure that you include a link to this forum post.

 
#3 Posted : Thursday, February 28, 2008 9:41:31 AM(UTC)
kgillispie

Groups: Registered
Posts: 8


The image file also grows when doing other updates like deskew, despeckle, add annotations.

Below is the information you requested:

ltkrn13n.dll Version: 13.0.0.12

----------------------------- delete snippet start -----------------------------

FOR I = 1 TO NoPagesToDel
PageNoToDelete = StartingPageNo
oiretcode = w_hiddenimagewindow.ole_lead.object.DeletePage(MultiPageFileName , PageNoToDelete)
IF oiretcode <> 0 THEN
setpointer(Arrow!)
MessageBox("Delete Page:Error" , "Error Code " + string(oiretcode))
return -1
END IF
NEXT

----------------------------- delete snippet end -----------------------------

----------------------------- deskew snippet start -----------------------------

retvalue = long(ole_lead.object.deskew())
IF retvalue <> 0 THEN
setpointer(Arrow!)
MessageBox("Deskew Image :Error", "Error Code " + string(retvalue))
return
END IF
ole_lead.object.ForceRepaint()

// force a save
ImageFileName = isMultiPageFileName
IF ImageFileName = "" THEN
setpointer(Arrow!)
MessageBox("Save Image :Error", "Error retrieving image file name " )
return
END IF

imagefileformat = 29
ole_lead.object.savepage = gwscanframe.iicurpagenoindoc
// Save all annotation in wang format
ole_lead.object.AnnSaveTag(TRUE , FALSE )

retvalue = ole_lead.object.save( ImageFileName , imagefileformat , 0 , 0 , 2 )
IF retvalue <> 0 THEN
setpointer(Arrow!)
MessageBox("Save Image :Error", "Error Code " + string(retvalue) + " " + ImageFileName )
return
END IF

----------------------------- deskew snippet end -----------------------------

----------------------------- despeckle snippet start -----------------------------

retvalue = long(ole_lead.object.despeckle())
IF retvalue <> 0 THEN
setpointer(Arrow!)
MessageBox("Despeckle Image :Error", "Error Code " + string(retvalue))
return
END IF
ole_lead.object.ForceRepaint()

// force a save
ImageFileName = isMultiPageFileName
IF ImageFileName = "" THEN
setpointer(Arrow!)
MessageBox("Save Image :Error", "Error retrieving image file name " )
return
END IF

imagefileformat = 29
ole_lead.object.savepage = gwscanframe.iicurpagenoindoc
// Save all annotation in wang format
ole_lead.object.AnnSaveTag(TRUE , FALSE )

retvalue = ole_lead.object.save( ImageFileName , imagefileformat , 0 , 0 , 2 )
IF retvalue <> 0 THEN
setpointer(Arrow!)
MessageBox("Save Image :Error", "Error Code " + string(retvalue) + " " + ImageFileName )
return
END IF

----------------------------- despeckle snippet end -----------------------------
File Attachment(s):
LEADTOOLSimage.zip (1,838kb) downloaded 17 time(s).
 
#4 Posted : Thursday, February 28, 2008 10:51:41 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


I spoke with the developers and they said that the DeletePage method only modifies header information.  Therefore, if all you do is call DeleteFile, the image size shouldn't change at all, which I confirmed on my end.

In version 14.5, we added a new API function called L_CompactFile which you could use to get rid of the data in the file after you've done some delete operations.  This is not in the v14.5 OCX control but you can still use L_CompactFile by declaring the API function just like you would any other Windows API function.

If you want to delete pages and the data, you need will need to save the file in overwrite mode for the first page you're keeping, then save the rest of the pages with the append mode.

As for the other functions, I'd have to look into it further if it is still a problem after fixing your page removal code.  With the deletepage method leaving data in your file, it's hard to say what's to be expected anymore.

If interested in upgrading to 14.5, please send an email to sales@leadtools.com for pricing information.
 
#5 Posted : Friday, February 29, 2008 5:58:13 AM(UTC)
kgillispie

Groups: Registered
Posts: 8


Thanks for the information about the delete and L_CompactFile API call. We have 15, but haven't upgraded our clients yet.

Can you look into the deskew and despeckle issue? The files get bigger even if you don't delete pages.

I have attached the images.

Thanks for your help!
Kreg Gillispie
File Attachment(s):
LEADTOOLSimage2.zip (817kb) downloaded 17 time(s).
 
#6 Posted : Friday, February 29, 2008 6:12:06 AM(UTC)
kgillispie

Groups: Registered
Posts: 8


I looked in the help file for DeleteFile - it's not there. Am I correct in assuming that it is in post-version 13?
 
#7 Posted : Friday, February 29, 2008 7:36:57 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


Sorry, I meant DeletePage.  There is no function named DeleteFile.

As for the deskew and despeckle, please send a small sample project (NOT your entire application) that isolates this problem so I can try to reproduce it here.  I'd like to be comparing apples to apples.
 
#8 Posted : Friday, February 29, 2008 8:13:43 AM(UTC)
kgillispie

Groups: Registered
Posts: 8


Thanks for clearing up the DeleteFile/DeletePage issue.

Unfortunately, I would have to give you our entire application(very large) to get the functionality. I sent the code snippets in an earlier post. If you can't do any more analysis, that's OK.

I am going to try the L_CompactFile when we upgrade.

I appreciate your help.

Kreg Gillispie
 
#9 Posted : Friday, February 29, 2008 8:49:59 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


I recheked your snippets and the problem isn't with deskewing or despeckling but with saving the image.  When you use the replace save mode, it does a similar thing as DeletePage.  The replace mode will delete the header informatoin that links to the specific page, but will not remove the actual data.  Therefore it's like using the append mode, then calling DeletePage.  L_CompactFile will resolve this issue.
 
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.264 seconds.