ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Problem with TIFF with compression ioTIFF_G3FAX1D

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
rlange Posted - Aug 21 2012 : 04:57:43
Given is a TIFF file with ioTIFF_G3FAX1D compression type.
When i just save this file (see delphi code below), the file is not readable by different applications like Adobe Acrobat X or IrfanView. They just show a blank image.
Is it possible to save the image with the same compression type so that it is readable by all applications?
Can someone help me to solve this problem?
Thank you in advance.


var
	iev1:TImageENView;
begin
	iev1:=TImageENView.Create(Self);
	try
		iev1.IO.LoadFromFileTIFF('2a.tif');
		iev1.IO.SaveToFileTIFF('2b.tif');
	finally
		iev1.Free;
	end;
end;


Your can download the TIFF files here:
Input file (readable):
http://kunde.iquadrat.de/iquadrat/attachments/2a.tif
Output file (not readable):
http://kunde.iquadrat.de/iquadrat/attachments/2b.tif
8   L A T E S T    R E P L I E S    (Newest First)
rlange Posted - Aug 21 2012 : 09:04:29
Thank you William Miller for your effort.
w2m Posted - Aug 21 2012 : 08:35:21
After futher review it turns out I got my compression files mixed up. The ioTIFF_G3FAX1D image I created opens as a blank image in IrfanView, but its properties dialog is filled. The ioTIFF_G3FAX1D displays correctly in MicrosoftOffice picture viewer, Windows 7 Paint, Windows 7 Live Photogallery, Windows7 PhotoViewer and in ImageEN itself.


William Miller
w2m Posted - Aug 21 2012 : 08:01:00
How did you set the compression when you created 2b.tif?

Did you try my code?

I also tried setting the compression manually where TFormTIFFCompression contains a combobox with these items:
Uncompressed TIFF
(CCITT1D) Bilevel Huffman compression.
(G3FAX1D) Bilevel Group 3 CCITT compression, monodimensional.
(G3FAX2D Bilevel Group 3 CCITT compression, bidimensional.
(G4FAX) Bilevel Group 4 CCITT compression, bidimensional.
(LZW) compression. Supports alpha channel.
(OLDJPEG) Ver.6.0 jpeg compression (unsupported).
(JPEG) Jpeg compression. Only true color images
(PACKBITS) RLE compression. Supports alpha channel.
(ZIP) compression (non TIFF standard). No alpha channel.
(DEFLATE) Adobe ZIP compression (non TIFF standard). No alpha channel.
(TIFF_UNKNOWN) Unknown compression

procedure TForm1.TIFFCompression1Click(Sender: TObject);
begin
  FormTIFFCompression := TFormTIFFCompression.Create(self);
  try
    FormTIFFCompression.ImageEnView1.Assign(ImageEnView1);
    if (FormTIFFCompression.ShowModal = mrok) and (not FormTIFFCompression.FApplied) then
    begin
     ImageEnView1.IO.Params.TIFF_Compression := TIOTIFFCompression(FormTIFFCompression.TIFFCompression1.ItemIndex);
     ImageEnView1.Update;
     // Build the save picture dialog filter
      SavePictureDialog1.Filter := '';
      SavePictureDialog1.Filter := SavePictureDialog1.Filter + 'TIF Bitmap (*.tif; *.tiff)|*.tif;*.tiff|';
      SavePictureDialog1.DefaultExt := '.tif';
      SavePictureDialog1.FileName := ExtractFilename(ImageEnView1.IO.Params.FileName);
      SavePictureDialog1.Title := 'Save As- ' + ImageEnView1.IO.Params.FileName;
      if SavePictureDialog1.Execute then
      begin
        if SavePictureDialog1.FileName <> '' then
        begin
          Screen.Cursor := crHourGlass;
          try
            FFilename := SavePictureDialog1.FileName;
            ImageEnView1.IO.SaveToFileTIFF(SavePictureDialog1.FileName);
            Caption := 'ImageEnIO From A to Z- ' + SavePictureDialog1.FileName;
          finally
            Screen.Cursor := crDefault;
          end;
        end;
      end;
    end;
  finally
    FormTIFFCompression.Free;
  end;
end;


Both IO.DoPreviews and manually setting ioTIFF_G3FAX1D then save the image both work as expected here. The ioTIFF_G3FAX1D image is sucesfully displayed in IrfranView here.

Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
William Miller
rlange Posted - Aug 21 2012 : 07:28:31
Thank you for your responses.

This is a riddle to me that IrfanView shows the 2b.tif picture correctly. I just installed the newest version, also on Win7 / 64 and still the same.

I know that all the other compression types are working fine. The problem is only the G3FAX1D compression (Constant ioTIFF_G3FAX1D).
Unfortunately one of our customer has only G3FAX1D compressed TIFF files and he cannot open the files in some applications (some do, some don't).
ehkhalid Posted - Aug 21 2012 : 07:14:19
well, with the first and the second image, there are no problem to view it with ivanview , paint and windows viewer (i have win 7 64 bit).
w2m Posted - Aug 21 2012 : 07:09:30
When I save the tiff file with varoius compression values they all load sucesfully in IrfanView:
CCTITT2D, G2FAC2D, G4FXX, JPEG, LZW, PACKBITS AND ZIP.

This is my code:

procedure TForm1.SaveToFileTIFF1Click(Sender: TObject);
begin
  if FileExists(ImageEnView1.IO.Params.FileName) then
  begin
    if ImageEnView1.IO.DoPreviews([ppTIFF]) then // set the compression in the IOPreviewsDialog
    begin
      // Build the save picture dialog filter
      SavePictureDialog1.Filter := '';
      SavePictureDialog1.Filter := SavePictureDialog1.Filter + 'TIF Bitmap (*.tif; *.tiff)|*.tif;*.tiff|';
      SavePictureDialog1.DefaultExt := '.tif';
      SavePictureDialog1.FileName := ExtractFilename(ImageEnView1.IO.Params.FileName);
      SavePictureDialog1.Title := 'Save As- ' + ImageEnView1.IO.Params.FileName;
      if SavePictureDialog1.Execute then
      begin
        if SavePictureDialog1.FileName <> '' then
        begin
          Screen.Cursor := crHourGlass;
          try
            FFilename := SavePictureDialog1.FileName;
            ImageEnView1.IO.SaveToFileTIFF(SavePictureDialog1.FileName);
            Caption := 'ImageEnIO From A to Z- ' + SavePictureDialog1.FileName;
          finally
            Screen.Cursor := crDefault;
          end;
        end;
      end;
    end;
  end;
end;


Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html

William Miller
rlange Posted - Aug 21 2012 : 06:06:03
Oh sorry, i uploaded the input TIFF file.

Here is the output TIFF file which is not displayed properly:

http://kunde.iquadrat.de/iquadrat/attachments/2b.tif

I changed also the first post.
w2m Posted - Aug 21 2012 : 05:57:07
I downloaded your image and sucessfully loaded it into
IrfanView, pictureviewer, microsoft office, Windows Paint, imageen... and about 8 other image applications... on Windows 7.

Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html

William Miller