LEADTOOLS Support
Imaging
Imaging SDK Questions
RasterCodecs.Convert takes only 1st page in TIFF->TIFF conversion
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, May 12, 2006 7:49:22 AM(UTC)
Groups: Registered
Posts: 2
I am using the RasterCodecs' Convert function to convert preexisting tiffs in any format to G4Tiffs but when I look at the output images it is only reading the first page. Does anyone know of a way around this?
#2
Posted
:
Tuesday, May 16, 2006 2:44:50 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You are probably using the wrong overloads of the Load and Save methods. Try using this syntax:
Image = Codecs.Load(sourceFile, 0, 0, 1, -1);
Codec.Save(Image, targetFile, Tif, 24, 1, Image.PageCount, 1, Append);
#3
Posted
:
Tuesday, July 18, 2006 4:31:20 AM(UTC)
Groups: Registered
Posts: 2
I don't understand this answer, because the Convert function does not require Load() and Save()
I'm having the same problem - Only one TIFF page being saved with Convert(), and also with Load() /Resize/ Save(), if I do it that way - The source image has 3 pages, but the DestinationImage object from the Resize command only has one page! (I'm trying to Resize and convert a standard TIFF to a JPEG-compressed multipage TIFF)
I also notice now that when I step thru pages and resize each page individually and append pages to the file one at a time, a page from the previous image is appearing as the 1st page when I save, even though when I'm stepping thru the file structure, I'm creating new IRasterImage and ResizeCommand objects each time.
This is driving me up the wall, and Help documentation for a lot of .NET properties and Methods only list syntax - It doesn't tell you anything about the purpose or behavior of the Properties & Methods.
For example with Convert, the role of the CodecsImageInfo object is not explained at all - And most of the properties are Read-only!!!! And when I derive the CodecsImageInfo object from the old image (which has the PageCount I want), it has no affect on the output files' PageCount - How do you tell LeadTools to just resize & convert the whole image ?????? It's gotta be simpler than this!
I'm using version 14.0
#4
Posted
:
Tuesday, July 18, 2006 7:28:16 AM(UTC)
Groups: Registered
Posts: 2
Ahhh... Found the problem with the phantom image being saved to the TIFF file...
I have to save page one of the TIFF using the CodecsSavePageMode.Overwrite option, then use the CodecsSavePageMode.Append on all the other pages.
Using CodecsSavePageMode.Append on a non-existant file seems to be trying to append to some other file in the output directory or something, even though it creates a new file (???)
#5
Posted
:
Wednesday, July 19, 2006 5:57:54 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Using append on a non-existing file should just create the file and save to it. But the approach you are using is also correct.
LEADTOOLS Support
Imaging
Imaging SDK Questions
RasterCodecs.Convert takes only 1st page in TIFF->TIFF conversion
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.