Changeset 13061 in josm for trunk/src/com/drew/metadata/exif/ExifReader.java
- Timestamp:
- 2017-10-30T22:46:09+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/metadata/exif/ExifReader.java
r10862 r13061 1 1 /* 2 * Copyright 2002-201 6Drew Noakes2 * Copyright 2002-2017 Drew Noakes 3 3 * 4 4 * Licensed under the Apache License, Version 2.0 (the "License"); … … 42 42 * @author Drew Noakes https://drewnoakes.com 43 43 */ 44 @SuppressWarnings("WeakerAccess") 44 45 public class ExifReader implements JpegSegmentMetadataReader 45 46 { 46 47 /** Exif data stored in JPEG files' APP1 segment are preceded by this six character preamble. */ 47 48 public static final String JPEG_SEGMENT_PREAMBLE = "Exif\0\0"; 48 49 private boolean _storeThumbnailBytes = true;50 51 public boolean isStoreThumbnailBytes()52 {53 return _storeThumbnailBytes;54 }55 56 public void setStoreThumbnailBytes(boolean storeThumbnailBytes)57 {58 _storeThumbnailBytes = storeThumbnailBytes;59 }60 49 61 50 @NotNull … … 89 78 } 90 79 91 /** Reads TIFF formatted Exif data a specified offset within a {@link RandomAccessReader}. */80 /** Reads TIFF formatted Exif data at a specified offset within a {@link RandomAccessReader}. */ 92 81 public void extract(@NotNull final RandomAccessReader reader, @NotNull final Metadata metadata, int readerOffset, @Nullable Directory parentDirectory) 93 82 { 83 ExifTiffHandler exifTiffHandler = new ExifTiffHandler(metadata, parentDirectory); 84 94 85 try { 95 86 // Read the TIFF-formatted Exif data 96 87 new TiffReader().processTiff( 97 88 reader, 98 new ExifTiffHandler(metadata, _storeThumbnailBytes, parentDirectory),89 exifTiffHandler, 99 90 readerOffset 100 91 ); 101 92 } catch (TiffProcessingException e) { 93 exifTiffHandler.error("Exception processing TIFF data: " + e.getMessage()); 102 94 // TODO what do to with this error state? 103 95 e.printStackTrace(System.err); 104 96 } catch (IOException e) { 97 exifTiffHandler.error("Exception processing TIFF data: " + e.getMessage()); 105 98 // TODO what do to with this error state? 106 99 e.printStackTrace(System.err);
Note:
See TracChangeset
for help on using the changeset viewer.