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 : Friday, November 17, 2006 5:16:11 AM(UTC)
sosoprince

Groups: Registered
Posts: 24


I want to know can i create a mulit-page (single-stripe) tiff (old jpeg compression) image that can be opened by MS document Imaging image by using leadtools 14.5?

I know that document imaging only support a few tiff (jpeg compression) standard

 

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 : Saturday, November 18, 2006 11:54:05 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

You can do that.  Which programming interface are you using (e.g. COM, OCX, API, etc.)?

 
#3 Posted : Sunday, November 19, 2006 3:10:52 AM(UTC)
sosoprince

Groups: Registered
Posts: 24


C#.Net 2003. Thanks
 
#4 Posted : Sunday, November 19, 2006 4:58:46 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

If you are using the .NET classes, then set the TileWidth property to a
value greater than the image width, and the TileHeight property to a
value greater than the height of the image.  Refer to the .NET class library help file to see how to use those proeprties.

 
#5 Posted : Sunday, November 19, 2006 6:16:17 AM(UTC)
sosoprince

Groups: Registered
Posts: 24


Sorry it seem to be not working. I also have to make the tiff to be single stripe. Here is my code

 

   RasterCodecs.CodecsPath = @"C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 14.5\Bin\Dotnet\v11";
   codecs = new RasterCodecs();

   codecs.Options.Load.TiledMemory = false;  

   image = codecs.Load(txtSrc.Text, 0, CodecsLoadByteOrder.BgrOrGray, 1, -1);

   codecs.Options.Jpeg.Save.QualityFactor = 65;
   codecs.Options.Jpeg.Save.Passes = 1; 

   codecs.Options.Jpeg.Save.SaveOldJtif = true;            

   codecs.Options.Tiff.Save.NoSubFileType = true;
   codecs.Options.Tiff.Save.SavePlanar = false;
  
   codecs.Options.Tiff.Save.UseTileSize = true;   
   codecs.Options.Tiff.Save.TileHeight = image.Height + 10;
   codecs.Options.Tiff.Save.TileWidth = image.Width * 2;   
   
   codecs.Options.Tiff.Save.NoPageNumber = true;
   codecs.Options.Tiff.Save.UseImageFileDirectoryOffset = true;

   codecs.Save(image, txtDst.Text, RasterImageFormat.TifJpeg422, 8, 1, image.PageCount, 1, Leadtools.Codecs.CodecsSavePageMode.Overwrite);   

   byte[] byteArray = new byte[2];
   byteArray[0] = 0x1;   
   
   RasterTagMetadata tag = new RasterTagMetadata(266, RasterTagMetadataDataType.UInt16, byteArray);   

   RasterTagMetadataCollection tags = new RasterTagMetadataCollection();
   tags.Add(tag);


   for (int i = 1; i <= image.PageCount; i++)
   {
    codecs.DeleteTag(txtDst.Text, i, 254);
    codecs.DeleteTag(txtDst.Text, i, 274);
    codecs.DeleteTag(txtDst.Text, i, 277);
    codecs.DeleteTag(txtDst.Text, i, 284);
    codecs.DeleteTag(txtDst.Text, i, 297);    

    codecs.WriteTags(txtDst.Text, i, tags);
   }

 
#6 Posted : Wednesday, November 22, 2006 6:36:10 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

It works for me.  The following lines are enough to save a single stripe file:

codecs.Options.Tiff.Save.UseTileSize = true;   
codecs.Options.Tiff.Save.TileHeight = image.Height + 10;
codecs.Options.Tiff.Save.TileWidth = image.Width * 2;

How are you checking that the file is tiled or striped?  Can you please post the resulting file you got?

 
#7 Posted : Wednesday, November 22, 2006 7:39:50 PM(UTC)
sosoprince

Groups: Registered
Posts: 24


The format is corrected when

 codecs.Options.Jpeg.Save.SaveOldJtif = false;

The result is incorrect when .SaveOldJtif = true;

Actually i want to format to be old jpeg but the compression is new jpeg format. This is my client requirement

Do you have any idea on how to do that ??

 

 

 

 
#8 Posted : Wednesday, November 22, 2006 11:44:19 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

When I set SaveOldJtif to True I get a striped image.  Do you get a tiled image?

 
#9 Posted : Thursday, November 23, 2006 1:18:29 AM(UTC)
sosoprince

Groups: Registered
Posts: 24


But it cannot opened in MS Document Imaging
 
#10 Posted : Thursday, November 23, 2006 4:43:41 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

It doesn't seem that MS Document Imaging supports old-style
JTIFs.  When I set SaveOldJtif to False MS Document Imaging opens the file.

 
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.082 seconds.