commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Groß (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (IMAGING-165) TiffReader.Collector adds values to a field List<TiffField> but never uses it
Date Sun, 22 Feb 2015 06:30:11 GMT

    [ https://issues.apache.org/jira/browse/IMAGING-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14332057#comment-14332057
] 

Michael Groß edited comment on IMAGING-165 at 2/22/15 6:29 AM:
---------------------------------------------------------------

addField is used heavily - a print statement in addField displayed many TiffField like this:
{noformat}
271 (0x10f: Make): 'Canon' (6 ASCII)
272 (0x110: Model): 'Canon EOS 400D DIGITAL' (23 ASCII)
274 (0x112: Orientation): 1 (1 Short)
282 (0x11a: XResolution): 72 (1 Rational)
283 (0x11b: YResolution): 72 (1 Rational)
296 (0x128: ResolutionUnit): 2 (1 Short)
305 (0x131: Software): 'GIMP 2.4.7' (11 ASCII)
306 (0x132: DateTime): '2009:11:28 19:51:53' (20 ASCII)
531 (0x213: YCbCrPositioning): 2 (1 Short)
34665 (0x8769: ExifOffset): 212 (1 Long)
33434 (0x829a: ExposureTime): 1/60 (0.017) (1 Rational)
{noformat}


was (Author: mgmechanics):
addField is used heavily - a print statement in addField displayed many TiffField like this:
{noformat}

Running org.apache.commons.imaging.formats.jpeg.JpegWithJpegThumbnailTest
===============================================
ADDED TIFF FIELD!!!
271 (0x10f: Make): 'Canon' (6 ASCII)
===============================================
===============================================
ADDED TIFF FIELD!!!
272 (0x110: Model): 'Canon EOS 400D DIGITAL' (23 ASCII)
===============================================
===============================================
ADDED TIFF FIELD!!!
274 (0x112: Orientation): 1 (1 Short)
===============================================
===============================================
ADDED TIFF FIELD!!!
282 (0x11a: XResolution): 72 (1 Rational)
===============================================
===============================================
ADDED TIFF FIELD!!!
283 (0x11b: YResolution): 72 (1 Rational)
===============================================
===============================================
ADDED TIFF FIELD!!!
296 (0x128: ResolutionUnit): 2 (1 Short)
===============================================
===============================================
ADDED TIFF FIELD!!!
305 (0x131: Software): 'GIMP 2.4.7' (11 ASCII)
===============================================
===============================================
ADDED TIFF FIELD!!!
306 (0x132: DateTime): '2009:11:28 19:51:53' (20 ASCII)
===============================================
===============================================
ADDED TIFF FIELD!!!
531 (0x213: YCbCrPositioning): 2 (1 Short)
===============================================
===============================================
ADDED TIFF FIELD!!!
34665 (0x8769: ExifOffset): 212 (1 Long)
===============================================
===============================================
ADDED TIFF FIELD!!!
33434 (0x829a: ExposureTime): 1/60 (0.017) (1 Rational)
===============================================
{noformat}

> TiffReader.Collector adds values to a field List<TiffField> but never uses it
> -----------------------------------------------------------------------------
>
>                 Key: IMAGING-165
>                 URL: https://issues.apache.org/jira/browse/IMAGING-165
>             Project: Commons Imaging
>          Issue Type: Improvement
>          Components: Format: TIFF
>            Reporter: Michael Groß
>             Fix For: Discussion
>
>
> org.apache.commons.imaging.formats.tiff.TiffReader.Collector adds values to a field List<TiffField>
but never uses it. This could be the cause of some problems reported elsewhere.
> TiffReader contains an embedded class named Collector. This class has a private field
named
> {noformat}
> private static class Collector implements Listener {
>         private final List<TiffField> fields = new ArrayList<TiffField>();
> {noformat}
> There are values added in a method named
> {noformat}
> public boolean addField(final TiffField field) {
>      fields.add(field);
>      return true;
> }
> {noformat}
> This method is the only which uses this field so these values are never used. Is there
a getter missing? Or was it intended to use these values in class TiffContents like "tiffHeader"
and "directories"?
> {noformat}
> public TiffContents getContents() {
>     return new TiffContents(tiffHeader, directories);
> }
> {noformat}
> At least the method "addField" seems unused but necessary to implement the "Listener"
interface.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message