Changeset 15219 in josm for trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
- Timestamp:
- 2019-07-07T02:23:14+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
r14624 r15219 5 5 import java.io.IOException; 6 6 import java.util.Date; 7 import java.util.List; 7 8 import java.util.Objects; 8 9 import java.util.function.Consumer; … … 21 22 import com.drew.metadata.exif.ExifIFD0Directory; 22 23 import com.drew.metadata.exif.GpsDirectory; 24 import com.drew.metadata.iptc.IptcDirectory; 23 25 import com.drew.metadata.jpeg.JpegDirectory; 24 26 … … 41 43 /** Temporary source of GPS time if not correlated with GPX track. */ 42 44 private Date exifGpsTime; 45 46 private String iptcCaption; 47 private String iptcHeadline; 48 private List<String> iptcKeywords; 49 private String iptcObjectName; 43 50 44 51 /** … … 333 340 public void setExifImgDir(Double exifDir) { 334 341 this.exifImgDir = exifDir; 342 } 343 344 /** 345 * Sets the IPTC caption. 346 * @param iptcCaption the IPTC caption 347 * @since 15219 348 */ 349 public void setIptcCaption(String iptcCaption) { 350 this.iptcCaption = iptcCaption; 351 } 352 353 /** 354 * Sets the IPTC headline. 355 * @param iptcHeadline the IPTC headline 356 * @since 15219 357 */ 358 public void setIptcHeadline(String iptcHeadline) { 359 this.iptcHeadline = iptcHeadline; 360 } 361 362 /** 363 * Sets the IPTC keywords. 364 * @param iptcKeywords the IPTC keywords 365 * @since 15219 366 */ 367 public void setIptcKeywords(List<String> iptcKeywords) { 368 this.iptcKeywords = iptcKeywords; 369 } 370 371 /** 372 * Sets the IPTC object name. 373 * @param iptcObjectName the IPTC object name 374 * @since 15219 375 */ 376 public void setIptcObjectName(String iptcObjectName) { 377 this.iptcObjectName = iptcObjectName; 378 } 379 380 /** 381 * Returns the IPTC caption. 382 * @return the IPTC caption 383 * @since 15219 384 */ 385 public String getIptcCaption() { 386 return iptcCaption; 387 } 388 389 /** 390 * Returns the IPTC headline. 391 * @return the IPTC headline 392 * @since 15219 393 */ 394 public String getIptcHeadline() { 395 return iptcHeadline; 396 } 397 398 /** 399 * Returns the IPTC keywords. 400 * @return the IPTC keywords 401 * @since 15219 402 */ 403 public List<String> getIptcKeywords() { 404 return iptcKeywords; 405 } 406 407 /** 408 * Returns the IPTC object name. 409 * @return the IPTC object name 410 * @since 15219 411 */ 412 public String getIptcObjectName() { 413 return iptcObjectName; 335 414 } 336 415 … … 556 635 557 636 ifNotNull(dirGps.getGpsDate(), this::setExifGpsTime); 637 638 IptcDirectory dirIptc = metadata.getFirstDirectoryOfType(IptcDirectory.class); 639 if (dirIptc != null) { 640 ifNotNull(ExifReader.readCaption(dirIptc), this::setIptcCaption); 641 ifNotNull(ExifReader.readHeadline(dirIptc), this::setIptcHeadline); 642 ifNotNull(ExifReader.readKeywords(dirIptc), this::setIptcKeywords); 643 ifNotNull(ExifReader.readObjectName(dirIptc), this::setIptcObjectName); 644 } 558 645 } 559 646
Note:
See TracChangeset
for help on using the changeset viewer.