Print Page | Close Window

Unknown JPEG 2000 file type

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3546
Printed Date: 19 Apr 24 at 2:38PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Unknown JPEG 2000 file type
Posted By: geonetwork
Subject: Unknown JPEG 2000 file type
Date Posted: 15 Feb 18 at 9:43AM
Hi everybody,

I'm using Delphi Tokyo 10.2.2 and DebenuPDFLibrary 14.11 (I've tried with 13.12 also).

I'm using this simple code to load a graphics field into a TImage

Image1.Picture.Assign((FieldByName('IMAGE') as TGraphicField))

As soon as the unit DebenuPDFLibrary is included in a project, I get this exception: Unknown JPEG 2000 file type.

If I remove DebenuPDFLibrary unit then exception disapear.

Any ideas?



Replies:
Posted By: Ingo
Date Posted: 15 Feb 18 at 9:16PM
Where can we download and check the graphic file?
jpeg2000 is already supported for many years now...
What does QuickPDF in your delphi project?
A more complete code snippet would be useful.
Perhaps the question is how to fill the TGraphicField...



-------------
Cheers,
Ingo



Posted By: tfrost
Date Posted: 15 Feb 18 at 10:26PM
We really need to see some of your code to help with this.  You imply that merely including the unit causes the problem without adding any API calls to QuickPDF.  If this is true, then you need to look for a match between symbols defined in the QuickPDF API and those defined elsewhere in your application and used units. If you have duplicated names, you are likely to see an exception.  Perhaps altering the position of DebenuPDFLibrary in the units list will help you narrow this down, but it is unlikely to fix the real problem.

Finally, when you trace with the debugger using the debug Delphi DCU files, where precisely does the exception occur and what is in the stack at that moment?  As you move up the stack, do you see unexpected units being visited?


Posted By: John Whitham
Date Posted: 04 Oct 18 at 4:24PM
I have encountered this error when loading an picture into a TImage from stream saved out of QuickPDF. For me it came from not being specific about loading different types. So:

                if pdfdoc.ImageType in [1,3] then
                  image2.Picture.LoadFromStream(astream)
                else if pdfdoc.ImageType = 2 then
                  image2.Picture.Bitmap.LoadFromStream(astream);

works for TIFF, JPEG and BMP whereas

                image2.Picture.LoadFromStream(astream);

with a BMP gives the "Unknown JPEG 2000" error in TImage.loadfromstream.


Posted By: geonetwork
Date Posted: 04 Oct 18 at 4:39PM
The issue has been fixed in 14.12 release.


Posted By: geonetwork
Date Posted: 04 Oct 18 at 4:56PM
My case was different, but I solved replacing:

Picture.Assign((FieldByName('IMAGE') as TGraphicField));

with 

Picture.Bitmap.Assign((FieldByName('IMAGE') as TGraphicField));

I hope it can help you



Posted By: Ingo
Date Posted: 04 Oct 18 at 7:21PM
Hi John,

jpeg2000-support seems to be complex stuff?
What's important regarding this issue is the QP-version you're using.
Jpeg2000-support was first introduced with version 7.26
An additional enhancement was released with version 8.16
The versions 10.16 and 15.11 came along with some fixes regarding jpeg2000-support.
If you're using a version before 15.11 or 10.16...



-------------
Cheers,
Ingo



Posted By: lsc82
Date Posted: 13 Nov 18 at 10:33AM

Hi,

I have this problem with QuickPDF 13.12. 

I use Report Builder (Digital Metaphors 19.2 - latest)

Only DECLARING DebenuPDFLibrary in the project - NOT USING IT - the report generation process with BITMAP image raise an error:

Unknown JPEG 2000 file type

The problem raise here:

// for bitmaps, call DataPipeline.GetFieldAsPicture
                 if (lGraphicClass = TBitmap) then
                   FPicture.Assign(DataPipeline.GetFieldAsPicture(DataField))  <--- ERROR!
                 else
                   begin
                     lGraphic := lGraphicClass.Create;
                     lGraphic.LoadFromStream(lImageStream);
                     FPicture.Graphic := lGraphic;
                     lGraphic.Free;
                   end;
HOW to SOLVE this problem?

Thanks


Posted By: Ingo
Date Posted: 13 Nov 18 at 8:01PM
Hi Isc,

if you're removing the declaration of QuickPDF then it works again?
Like i've told here before:
Perhaps a change to version 15.11 can fix it.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: lsc82
Date Posted: 14 Nov 18 at 1:08PM
Hi,

thanks for your reply, Ingo.

I understand "upgrade to solve" but this is not easy for us at this stage of our project (it was very hard to find the realtionship between YOUR component and the error on OTHER components, we spent MONTHS on it!!! AngryAngry )

What I don't really understand is HOW YOUR component interferes with an other one without being used, but only declared (perhaps it interferes with the BASIC delphi components!). 

I don't ask you to make a new 13.X version, solving this very dangerous behavior, but help us to do a work-around is a "minimum sign of comprehension". (We don't have your source code...)

Thanks




Posted By: Ingo
Date Posted: 14 Nov 18 at 1:46PM
Hi Isc,

what do you think who i am? ;-)
I'm a user as you are...
This is a forum ... a user forum - Not a publisher forum.
If you want any changes you should enter the official support page to enter a technical question.

"...
if you're removing the declaration of QuickPDF then it works again?
..."



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk