Skip to content
Snippets Groups Projects

Get all metadata

Merged Lars Brodin Østby requested to merge getAllMetadata into dev
7 unresolved threads

Added method to extract all metadata from image.

Merge request reports

Merge request pipeline #81539 passed

Merge request pipeline passed for f7c6e41a

Approval is optional

Merged by Lars Brodin ØstbyLars Brodin Østby 4 years ago (Apr 17, 2020 5:07pm UTC)

Merge details

  • Changes merged into dev with 36e677fb.
  • Deleted the source branch.

Pipeline #81612 passed

Pipeline passed for 36e677fb on dev

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
191 ", fileType='" + fileType + '\'' +
192 ", photoDate='" + photoDate + '\'' +
193 ", fileSize='" + fileSize + '\'' +
194 ", fileDimension='" + fileDimension + '\'' +
195 '}';
199 "\nmetadataId=" + metadataId +
200 "\ncamera='" + camera + '\'' +
201 "\nlens='" + lens + '\'' +
202 "\naperture='" + aperture + '\'' +
203 "\nshutterSpeed='" + shutterSpeed + '\'' +
204 "\nISO='" + ISO + '\'' +
205 "\nfocalLength='" + focalLength + '\'' +
206 "\nfileType='" + fileType + '\'' +
207 "\nphotoDate='" + photoDate + '\'' +
208 "\nfileSize='" + fileSize + '\'' +
209 "\nfileDimension='" + fileDimension + '\'' +
  • 58 59 @Column(name = "filedimension")
    59 60 private String fileDimension;
    60 61
    62 @Lob
    63 @Column(name = "allMetadata")
    64 private String allMetadata;
  • 58 59 @Column(name = "filedimension")
    59 60 private String fileDimension;
    60 61
    62 @Lob
  • 94 99 return camera;
    95 100 }
    96 101
    102 public String getAllMetadata(){
  • 358 358 textToClean = textToClean.substring(0, textToClean.length()-2);
    359 359 return textToClean;
    360 360 }
    361
    362 /**
    363 * Method for getting all metadata from an image
    364 * @param file that will be checked
    365 * @return metadata or an empty string if nothing was found
    366 */
    367 public static String getAllMetadata(File file){
  • 362 /**
    363 * Method for getting all metadata from an image
    364 * @param file that will be checked
    365 * @return metadata or an empty string if nothing was found
    366 */
    367 public static String getAllMetadata(File file){
    368 String allMetadata = " ";
    369 try {
    370 Metadata metadata = ImageMetadataReader.readMetadata(file);
    371 for (Directory directory : metadata.getDirectories()) {
    372 for (Tag tag : directory.getTags()) {
    373 allMetadata += tag + " #";
    374 }
    375 }
    376 } catch (IOException | ImageProcessingException | NullPointerException e) {
    377 logger.error("[x] Could not get information from file");
  • 358 358 textToClean = textToClean.substring(0, textToClean.length()-2);
    359 359 return textToClean;
    360 360 }
    361
    362 /**
    363 * Method for getting all metadata from an image
    364 * @param file that will be checked
    365 * @return metadata or an empty string if nothing was found
    366 */
    367 public static String getAllMetadata(File file){
    368 String allMetadata = " ";
    369 try {
    370 Metadata metadata = ImageMetadataReader.readMetadata(file);
    371 for (Directory directory : metadata.getDirectories()) {
    372 for (Tag tag : directory.getTags()) {
    373 allMetadata += tag + " #";
  • added 1 commit

    • f7c6e41a - various fixes to misc metadata

    Compare with previous version

  • mentioned in commit 36e677fb

  • Please register or sign in to reply
    Loading