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, April 13, 2009 10:09:20 AM(UTC)

daub815  
daub815

Groups: Registered
Posts: 4


I am trying to load an image from a http url.  Therefore, I am using codecs.FeedLoad.  The image seems to be reading fine, but as soon as I try to convert the image to an ImageSource, I get an error.  The error is: Specified cast is not valid.  A first chance exception of type 'System.InvalidCastException' occurred in PresentationCore.dll.

I am able to load the image and view the image using the FeedLoad demo, but I need the image to be converted to a .Net ImageSource not a RasterImage. 

I am using LeadTools Pro 16 SDK.  I was able to convert the JPEG2000 image before, but I cannot seem to convert this image.  Any suggestions? 
 

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, April 14, 2009 5:20:35 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,034

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

Does this mean your approach is working with other images, but fails with one image in particular? If yes, is there anything different about this image? Can you send me 2 images, one that works and another that fails? If you want to send the files, put them in a ZIP or RAR file and I will check it for you. You can either post it here or send it to support@leadtools.com

Please note that you don't have to use FeedLoad with URLs. You can simply use the RasterCodecs.Load method that takes a URI. Did you try that?

 
#3 Posted : Tuesday, April 14, 2009 5:37:25 AM(UTC)

daub815  
daub815

Groups: Registered
Posts: 4


Both the FeedLoad and Load codecs work fine.  I was able to determine the issue is with the RasterImageMediaConverter.  Once that method gets called, I get the Specified cast is not valid error.  In addition, the demos are able to load the image fine, but they are using the Leadtools ImageViewer and are not converting the image to a .Net Image.  Are there any logs or outputs from Leadtools that I can see what the actual error?
 
#4 Posted : Sunday, April 19, 2009 4:52:00 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,034

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

This issue was resolved through email. Here are the results for the general benefit.

After looking at the project, the final conclusion was that our functions worked correctly. In particular:
- FeedLoad will work correctly with JPEG2000 files if the data fed to it contains a valid image.
- RasterCodecs.Load(String) method only works with disk files. If there's a need to load in image from a URI, the RasterCodec.Load(System.Uri) overload should be used.
 
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.051 seconds.