Skip to main content
Question

Has anyone been able to expose the windows file "Title" Property?


We are working with a legacy dataset of scanned images and are moving everything to SharePoint. We discovered these files that have all the document information stored as a title property that is lost when moving to SharePoint. We are hoping that there is a way we can rename these files with the title information using FME. I have tried to expose it using the Directory and File Pathnames reader but cannot find the attribute anywhere.

image

2 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • April 12, 2023

Try exifReader custom transformer from FME Hub


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • April 12, 2023

If you read these with the JPG reader, you can see the jpeg_exif_imagedescription if you expose the attribute

imageThis can be slow however as involves opening up every image

The exifReader requires the installation of a third party tool which may or may not be an issue

If it's just the ImageDescription you need you may be able to use python, just sending the file path into a pythoncaller, I think PIL is part of the standard FME install

import fme
import fmeobjects
from PIL import Image
from PIL.ExifTags import TAGS
 
 
def ProcessFeature(feature):
    pil_img = Image.open(feature.getAttribute('path_windows'))
    exif_info = pil_img._getexif()
    exif = {TAGS.get(k, k): v for k, v in exif_info.items()}
    try:
        imgdesc = exif.get('ImageDescription')
        feature.setAttribute('ImageDescription',imgdesc)
    except:
        feature.setAttribute('ImageDescription',"")

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings