View Issue Details

IDProjectCategoryView StatusLast Update
0035081FPCFCLpublic2019-03-26 23:27
ReporterhanAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformWindows/LinuxOSOS Version10
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0035081: FCL-image, FPreadTIFF cant read RGB32 and FPwriteTIFF can't write Gray8 or Gray16
Description1) The reader FPreadTIFF reads correctly RGB24, RGB48, RGB64 formats but fails to read correctly RGB32. See attached files.

2) For FPwriteTIFF, I can force monchrome images as follows:

  Image.Extra['TiffGrayBits']:='16';
  Image.Extra['TiffPhotoMetric']:='0';

or

  Image.Extra['TiffGrayBits']:='8';
  Image.Extra['TiffPhotoMetric']:='0';


Looking into the code this looks like a bug.
See also my posting:
http://forum.lazarus.freepascal.org/index.php/topic,44257.0.html
Steps To ReproduceFor 1) try attached files.
TagsNo tags attached.
Fixed in Revision41802
FPCOldBugId
FPCTarget
Attached Files

Activities

han

2019-02-14 00:24

reporter  

tif test files.zip (461,291 bytes)

han

2019-02-14 00:26

reporter   ~0114096

Correction problem 2 is CAN NOT:
2) For FPwriteTIFF, I can't force monchrome images as follows:

circular

2019-02-15 12:49

reporter   ~0114140

I think this is solved in latest version of FPReadTiff (cf 0033668).

han

2019-02-21 20:03

reporter   ~0114339

Last edited: 2019-02-21 21:03

View 2 revisions

I tried to compile the latest code.

Problem 1) reading RGB32 is solved.
Problem 2) writing Gray16 is still there. It can't write Gray16/Gray8. It always write the three colors.

Michael Van Canneyt

2019-03-26 23:27

administrator   ~0115071

in rev 41802 I enhanced the imgconv example program. It shows how to correctly specify the options to do grayscale.

You used
  Image.Extra['TiffGrayBits']:='16';
  Image.Extra['TiffPhotoMetric']:='0';
When you should use unit fptiffcmn and use the CONSTANTS
  Image.Extra[TiffGrayBits]:='16';
  Image.Extra[TiffPhotoMetric]:='0';
You will see that TiffPhotoMetric expands to 'TiffPhotoMetricInterpretation'. So because you wrote your value with the wrong name, the grayscaling was in fact not done.

Issue History

Date Modified Username Field Change
2019-02-14 00:21 han New Issue
2019-02-14 00:22 Maxim Ganetsky Project Packages => FPC
2019-02-14 00:24 han File Added: tif test files.zip
2019-02-14 00:26 han Note Added: 0114096
2019-02-15 12:49 circular Note Added: 0114140
2019-02-15 13:52 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-02-15 13:52 Michael Van Canneyt Status new => assigned
2019-02-21 20:03 han Note Added: 0114339
2019-02-21 21:03 han Note Edited: 0114339 View Revisions
2019-03-26 23:27 Michael Van Canneyt Fixed in Revision => 41802
2019-03-26 23:27 Michael Van Canneyt Note Added: 0115071
2019-03-26 23:27 Michael Van Canneyt Status assigned => resolved
2019-03-26 23:27 Michael Van Canneyt Resolution open => no change required