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
 ImageEnMView - not loading TIFF

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
LukaL Posted - Apr 01 2014 : 23:34:59
Hi,

I've got a problem with loading TIFF image from a file. It's strange because 95% of my TIFF files are loaded OK - for some TIFF files ImageEn seems to ignore them.
In the link you can download the two TIFF samples. https://db.tt/2TnYb2NM

Sample A is not loading / Sample B is working fine.

In the code I'm using it as this :
iePriponkaMView.MIO.LoadFromFileTIFF( TmpFileName );

And when loading SampleA and checking iePriponkaMView.ImageCount its value is 0.
BUT when loading SampleB the ImageCount property is 1.

I've also tried your Demos and the same thing is happenig - not loading Sample A.

Thank you for your help.

Edit : typos
9   L A T E S T    R E P L I E S    (Newest First)
LukaL Posted - Apr 03 2014 : 23:27:33
Yes, your solution is more clean - I'm going to use it.

Thanks for all your help.
w2m Posted - Apr 03 2014 : 07:51:31
You would be better off using FindFileFormat which includes all supported ImageEnIO file types:

Declaration

function FindFileFormat(const FileName: WideString; VerifyExtension: Boolean): TIOFileType;

Description

Returns the file format of the specified file by reading the file and trying to recognize the file header.

If VerifyExtension is False, then FindFileFormat function doesn't use the file extension to determine the format. FineFileFormat uses FindStreamFormat to detect image format from file header.

Example

function GetFileType(AFilename): TIOFileType;
begin
  Result := FindFileFormat(AFilename, false);
end;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
LukaL Posted - Apr 03 2014 : 04:11:35
Hi,

nevermind my last question. I've used the code from this thread : http://www.delphipages.com/forum/showthread.php?t=174008

And it's working now.

Thank you for you help!
LukaL Posted - Apr 03 2014 : 03:41:30
Yes, you are correct - if I load the file with JPG extension - imageEn is rendering it OK.
Is there any way that I can determine image type when I load the image ?
xequte Posted - Apr 03 2014 : 02:44:00
Hi

Are we are looking at the same set of files? Img_Specimen_A.TIFF is a JPEG image. If you rename it to Img_Specimen_A.jpeg it will load correctly.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
LukaL Posted - Apr 02 2014 : 23:22:29
Hi,

unfortunately calling LoadFromFileAuto does not solve my problem. If I try to open the file on my system it opens in my default picture viewer and it's displayed ok. So I think the issue is in a loading bug (that you say it's going to be fixed in the upcomming version 5.1.0 ? ).

When I load my problematic TIFF like this :


ExtractTIFFImageStream( MSAll, MSImage, i );

  if ( MSImage.Size > 0 ) then
    iImageCount := ROUND( MSAll.Size / MSImage.Size )
  else
    iImageCount := 0;

  while ( i < iImageCount ) do
  begin
    iemview.InsertImage( i );
    MSImage.Position := 0;
    iemview.SetImageFromStream( i, MSImage );

    Inc( i );

    MSImage.Position := 0;
    ExtractTIFFImageStream( MSAll, MSImage, i );
  end;


It is working. BUT I don't want to go and replace my code with this workaround.
xequte Posted - Apr 02 2014 : 18:46:43
Hi

This does not open because it is a JPEG with a .TIFF file extension.

You can load it by having ImageEn ignore the file extension using LoadFromFileAuto:

http://www.imageen.com/help/TImageEnIO.LoadFromFileAuto.html


In 5.1.0 (coming very soon) you can use the helper function in iexHelperFunctions which will fall back to LoadFromFileAuto if LoadFromFile fails.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
LukaL Posted - Apr 02 2014 : 00:24:57
No, I'm using version 4.1.4.

Sorry I did not post this info in my original post.

xequte Posted - Apr 02 2014 : 00:06:08
Hi

Are you using v5.0.6? There is a loading bug in that version which we will be fixing very shortly.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com