It seems that there might be in effect three scenarios worth considering:

A) Ignore all metadata (ignoreMetadata [1] is true)

No metadata would be read except that required to read the image itself. This 
is related to another issue [2]. It is debatable whether any such essential 
metadata should be propagated to the ImageMetadata despite ignoreMetadata’s 
being true.

B) Ignore only metadata unknown to the TIFFImageReadParam (ignoreMetadata is 

Only metadata essential to reading the image or corresponding to TIFFTags 
present in the union of TIFFTagSets set on the TIFFImageReadParam would be 
read. Similarly to scenario (A), it is be debatable whether metadata essential 
to reading the image should be propagated to the ImageMetadata if there is no 
corresponding tag in the union of known TIFFTagSets. Note that the absence of a 
provided TIFFImageReadParam implies that the default TIFFTagSets delineated in 
the class description of TIFFImageReadParam [3] would be recognized.

C) Do not ignore any metadata (ignoreMetadata is false)

All metadata would be read including that corresponding to TIFFTags not present 
in the union of TIFFTagSets set on the TIFFImageReadParam.

The foregoing set of scenarios would allow the blanket disabling of reading 
metadata as intended by [1], while retaining the ability to have fine-grained 
control over which fields are read as intended by the original TIFF plugin code 
[4]. In order to distinguish between scenarios (B) and (C) an extra setting, 
e.g., “ignoreUnknownTags” on the TIFFImageReadParam would be required, and any 
other pertinent API documentation updated, including [4].



On Aug 17, 2016, at 11:09 AM, Phil Race <> wrote:

> That all seems fine (for the case of ignoreMetaData == true).
> But there may be still a bug - of some kind - uncovered by this test.
> The submitter has this case  :
> ignore = false:
> EXIF: true
> Fax : true
> GPS : true 
> which means that all metadata is being read .. as is the default per the docs
> on the TIFF package description. But I am wondering what the effect setting 
> of 
>  param.removeAllowedTagSet(FaxTIFFTagSet.getInstance());
> should have been in this case.
> A strict reading of the spec. makes it sound like it only has any effect
> when you specify ignoreMetadata == true but I don't see the point
> of the API in that case, since you are already ignoring metadata, unless
> it is just a matter of being more clear to the reader that the latitude
> it has to read metadata anyway regardless should be tempered by
> this additional call.
> But is there not also value in being able to remove the tag from
> the allowed set in the ignoreMetadata == false case ?
> That seemed to be the gist of the text here :-
> >In cases where the IFD includes fields which contain
> > large amounts of data this could be very inefficient.
> > Which fields are loaded may be controlled by setting
> >which TIFF tags the reader is allowed to recognize and whether it is 
> >ignoring metadata.
> eg .. "I want all metadata except Fax" ..

Reply via email to