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, March 17, 2021 8:18:40 AM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


I'm getting a return code of 20037 from CreateThumbnailFromFile. What is error 20037? Where is a list of these errors?
 

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 : Friday, March 19, 2021 8:50:04 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

Our current error codes don't have this value--are you using a legacy version? Which version of the toolkit are you using?
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Friday, March 19, 2021 8:54:45 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

The closest I could locate to this was -37 in our current documentation, signifying "Invalid Data".
https://www.leadtools.co...in/api/return-codes.html

This indicates the issue may be stemming from the image you're working with. Could you furnish us with that and the code you're using?
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#4 Posted : Monday, March 22, 2021 4:23:05 PM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


WE are using V13. I found a document with error codes for LEADTOOLS ePrint 5 COM methods. It has the 2xxxx errors. Assuming that they are the same as the imaging COM methods the error is

Error No. Description
ERROR_INVALIDDATA 20037 Internal error - call LEAD.

I'm calling. The image opens fine before being flipped. The image along with many other are selected and flipped. The error occurs on one of the images and the applications ends. When restarted the CreateThumbnailFromFile function that properly displayed the image thumbnail before the flip and that failed on the flip now fails when displaying the thumbnail of the image. The image is changed during the flip, originally it was a color jpeg of a BW document that is around 1 mb. After the flip, the image is around 3 mb.

I would have to create a stand-alone app to send the code. That is a last resort. How do I send the image files?
 
#5 Posted : Tuesday, March 23, 2021 3:29:10 PM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


I downloaded the current SDK and ran the MainDemo under Viewers and Displays for .NET, C, and C++, they all failed to open the image that failed on the flip. To be clear the pre-flip image opened fine in all three. The image after the flip failed in all three. The failing image opens in multiple Windows viewers.

.NET Error opening file
C++ Internal error - call Lead
C Leadtools DLL Error (-37)
Internal error - call Lead

How is this file corrupted?

File Attachment(s):
image-33-before rotate.jpg (1,235kb) downloaded 16 time(s).
File Attachment(s):
image-33-after rotate fail.jpg (3,363kb) downloaded 15 time(s).
 
#6 Posted : Wednesday, March 24, 2021 9:52:36 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

Thank you for including your images. After examining the file it appears some of the resync markers in it are invalid.

Could you furnish us with the code you're using to generate this image? The call to L_SaveBitmap() (or whichever LEADTOOLS function you're using to save the image) may be sufficient.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#7 Posted : Wednesday, March 24, 2021 1:12:20 PM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


Are the invalid resync markers only in the "failed" image?
Why isn't Lead able to display this image when various Windows and other utilities can?

Is there a way to detect this problem?
Is there a way to fix the image?

The rough code is below. They are all Leadtools functions. It is version 13 code. Is there a better way? Note that this flow has worked on a very large number of images over many years.

Load( path, 0, 0, 1 );

Rotate( 18000, ROTATE_RESIZE, RGB(0, 0, 255) );

bits = GetBitmapBits()
Save( path, 10, bits, 2, SAVE_OVERWRITE );

CreateThumbnailFromFile( path, 0 );


Subsequent calls to CreateThumbnailFromFile( path, 0 ) fail on the image.


Thanks for your assistance.
 
#8 Posted : Wednesday, March 24, 2021 4:45:50 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

These are only present in the "failed" file. One thing I did note is the input file is JPEG YUV 4:1:1 and the damaged output file is JPEG YUV 4:4:4. I'm unsure if this is a contributing factor. Is it possible to save the file to a different format (or the same as the original input) or use L_ResizeBitmap to scale the bitmap in memory down to a thumbnail size after the Rotate operation?

Note later versions of the toolkit do have the ability to partially load files damaged like this one, however, I'm unable to find anything in the v13 documentation stating that may be the case with this version.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#9 Posted : Tuesday, March 30, 2021 1:28:45 PM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


The good input file is from the scanner. The failed file is saved using Lead's Save function. How are you detecting the 4:1:1 vs 4:4:4? How could this be saved differently to get a 4:1:1 file?
 
#10 Posted : Tuesday, March 30, 2021 3:08:02 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

I examined the documents in the v21 MainDemo (in the "Open" Dialog, highlight the file and select the "File Info" button at the top right, second from the right) which reported the Format as JPEG (YUV 4:4:4).

I see you're passing "10" to your Save() call. Assuming this is the file format, in our documentation this correlates to JPEG File Interchange Format with YUV 4:4:4 color space. Looks like FILE_LEAD1JFIF (21) is YUV 4:1:1. Does the issue persist when modifying your save call?
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#11 Posted : Tuesday, April 6, 2021 9:04:47 AM(UTC)

mesa  
mesa

Groups: Registered
Posts: 23


I modified the code to use the 4:1:1 color space. The error continued. I modified the code to use a different quality setting in the Save so that the file size would remain roughly the same after the flip. That fixed my inhouse problem. At the client site neither change fixed their problem. I've asked them to test the two changes to see of one is better than the other. The client is scanning and displaying a very large number of images each day. A sizable number of those require flipping.

Any additional ideas would be greatly appreciated. Thanks for your help so far.
 
#12 Posted : Wednesday, April 7, 2021 11:41:20 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

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

Modifying the code as such likely changed how the data were saved in the image such that no invalid resync markers were formed. This may not be possible with every image. It may be the case this doesn't occur in a later version of the SDK--regretfully, v13 is out of maintenance.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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-2024, Yet Another Forum.NET
This page was generated in 0.131 seconds.