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, November 26, 2008 7:29:25 AM(UTC)

George  
George

Groups: Registered
Posts: 12


Hi, have a question:

How can i control the progress of saving a J2K file ?

If i use RasterCodecs codecs.SaveImage, it produces a corrupted j2k file.

I´m doing it into a BackgroundWorker.

Any ideas ?

Thanks

- Jorge -
 

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, November 26, 2008 9:58:03 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

Can you post the code for your Save() method call?  What version of the toolkit are you using and what language are you programming in?

How are you wanting to control the save process?  Do you want to write the compressed data yourself to a file?
 
#3 Posted : Wednesday, November 26, 2008 10:52:43 PM(UTC)

George  
George

Groups: Registered
Posts: 12


Hi again,

I´m using Leadtools Imaging Pro v16 under Visual Studio 2005 - C# (.NET)

The only thing i want is to increase a ProgressBar value, to see how the saving process goes.

The code is attached. The progress bar increases while saving, but the saved file is corrupted.

If you delete the line:
codecs.SaveImage+= new ...

the genereted file will be a correct j2k file, but then you can´t see the progress of saving.

Note 1: It´s included a generated file corrupted, created with the code.

Note 2: Original images are one paged tiffs of about 400 MB.

Thanks,

- Jorge -
 
#4 Posted : Wednesday, November 26, 2008 10:54:38 PM(UTC)

George  
George

Groups: Registered
Posts: 12


Don´t know if the code was attached.
Uploading again.
File Attachment(s):
VisorImagenes.zip (369kb) downloaded 17 time(s).
 
#5 Posted : Thursday, November 27, 2008 4:59:57 AM(UTC)

George  
George

Groups: Registered
Posts: 12


Hi,

have found the same problem saving a multi-page tiff. If I use the Codecs.SaveImage to control the saving progress, the file saved is corrupted, but its ok if don´t use it.

I can post the code if you need so.

Waiting reply.

 
#6 Posted : Monday, December 1, 2008 4:55:38 AM(UTC)

George  
George

Groups: Registered
Posts: 12


Hi.

Still waiting. Please i need a reply.
 
#7 Posted : Monday, December 1, 2008 12:42:26 PM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

Sorry for the delay.  I was out of the office for Thanksgiving holiday.  I will take a look at your project and reply back with my results.
 
#8 Posted : Tuesday, December 2, 2008 10:16:51 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

Hello Jorge,

With the SaveImage event you have to handle the setting of the buffer like this:

        void codecs_SaveImage(object sender, CodecsSaveImageEventArgs e)
        {
            // This line sets the buffer.
            e.Image.GetRow(e.Row, e.Buffer, e.Length);

            // Your code.
            int valPro = ((e.Row * 100) / e.Image.Height) % 100;
            tareaSalva.ReportProgress(valPro);
        }

Otherwise the buffer will stay empty.  I tested it out and now it works fine.
 
#9 Posted : Tuesday, December 2, 2008 10:10:58 PM(UTC)

George  
George

Groups: Registered
Posts: 12


I'll try it. Suposse that in the Multipaged Tiff case it will be the same problem.

Lots of thanks, jigar.
 
#10 Posted : Wednesday, December 3, 2008 4:52:00 AM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,022

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

Yes, it will work with multipage files too, but you will have to add one more line of code.  You'll have to do this before you call e.Image.GetRow():

e.Image.Page = e.Page;

You first have to set the correct page as above and then do the rest.
 
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.074 seconds.