Jump to content

Working with ProcessWire & getting EXIF data from images


MarcC
 Share

Recommended Posts

I'm considering a project where I may need to extract EXIF data from images and display it on a site. I've looked over methods of collecting the data, like external classes, and it seems fairly straightforward. But I'm wondering if there's any reason I can't use the Images fieldtype (and accompanying methods to resize) with tools like these, or anything else I should know? If anybody has experience with this, I'd appreciate any information you can share.

Link to comment
Share on other sites

I'm considering a project where I may need to extract EXIF data from images and display it on a site. I've looked over methods of collecting the data, like external classes, and it seems fairly straightforward. But I'm wondering if there's any reason I can't use the Images fieldtype (and accompanying methods to resize) with tools like these, or anything else I should know? If anybody has experience with this, I'd appreciate any information you can share.

 Hi Marty, Hi MarcC,

I'm not sure if I understand the question/s right, but I can point out some things that come to my mind when reading it:

The imagesfieldtype currently has only one description field what can collect data. This is a Textfield and can store data up to max 64kB. Depending on what EXifdata you need, it maybe a possible approach to store that with the description field (serialized?).

Accompanying resize-methods to the imagesfield needs to create an own imagesfield with this extensions. (Like ThumbnailsModule)

But I would prefer to store each image as a page and have all wanted single exif-data on that template as fields. To use images as pages is often discussed here, because it's flexible and scalable. Also Somas ImagesManager could be of interest.

So, regardless on how you organize your images, I think it would be pretty usefull if the fields get populated automatically somehow, - at upload for example. Saying that, I actually don't really know how to do it. (I'm PW-newbie (somehow), - hook into upload with a module - ok, but what comes after hooking may be very individual on someones need)

---

Note: when applying any Imagemanipulation with GD, every EXIF-data get stripped and is lost!

You should not manipulate your original images!

---

For reading and sorting Exifdata (and IPTC-data) I can provide some code if wanted.

  • Like 1
Link to comment
Share on other sites

I've taken a lofi approach to my site. Each image on its own page and page fields for exposure, f-stop and ISO - and Ryan's Map Marker field for interest sake. It's because a lot of exif data gets wiped (as Horst mentioned) through various editing apps and it's not that much of a bother to add that info in.

Link to comment
Share on other sites

I've taken a lofi approach to my site. Each image on its own page and page fields for exposure, f-stop and ISO - and Ryan's Map Marker field for interest sake. It's because a lot of exif data gets wiped (as Horst mentioned) through various editing apps and it's not that much of a bother to add that info in.

Hi Marty, I'm using that same 'lofi approach', - but waiting for Somas ImagesManager to become beta.

Also I've posted a question to him.

Link to comment
Share on other sites

Wow, very interesting information here, guys. Thanks very much. It seems like EXIF data gets stripped pretty easily. Here are some questions:

1. Is anybody doing a combination like: Attempt to read EXIF but fallback to custom fields for focal length, f-stop, etc. if EXIF data isn't available?

2. GD strips EXIF tags, but that only applies to resized/cropped extra versions of the image, right? Like those automatically created in the assets folder? Or does it somehow strip EXIF tags from the original as uploaded?

Hope I understood correctly :) Thanks!

Link to comment
Share on other sites

1. Is anybody doing a combination like: Attempt to read EXIF but fallback to custom fields for focal length, f-stop, etc. if EXIF data isn't available?

2. GD strips EXIF tags, but that only applies to resized/cropped extra versions of the image, right? Like those automatically created in the assets folder? Or does it somehow strip EXIF tags from the original as uploaded?

Hi Marc,

@ 2) actually your original images are kept without manipulations, so all EXIF is kept with them. (at least this is if you not have set a max-width or max-height with your images, this I actually don't and have to check by myself).

With all variations the EXIF is stripped!

@ 1) I don't know what Marty does but I'm interested to hear about too. I actually try to auto-populate my page fields with EXIF-data and then do a manually correction where needed. After that there are only Pagefields that get outputted to the frontend. EXIF-data reading is done only once.

I have written a little module with somas kind help that adds auto filling of EXIF-data to the Images Manager. I will post here in a few minutes when have uploaded a screencast.

Link to comment
Share on other sites

I have written a little module that extends Somas awesome Images Manager. Also it's written with Somas kind help, (thanks!)

It adds auto filling of EXIF or IPTC fields where available on upload of new images through Images Manager.

How to use it:

  • You, of course have Images Manager installed and ready to run.
     
  • Now you have to create some fields that should take your exif data: fieldname prefix is exif_ followed by the original exif-fieldname but lowercase!  ( exif_author, exif_copyright, etc.)
     
  • ALSO you have to create one TextArea field called (by default) image_exif, - this one and ...
    (not needed, only optional to get the full raw EXIF-data stored)
     
  • all your exif_fields you have to add to the image-template that is used by Images Manager for creating the new Image Pages.
     
  • then download and install the ImagesManagerMetadata module.

here are a little screencast I've done with it:

https://youtu.be/wjhJdT7Tf5Y

this is alpha, version 0.0.2  ImagesManagerMetadata.zip

Edited by horst
  • Like 6
Link to comment
Share on other sites

Nice one Horst!

I don't think you have to add the images_exif textarea to have it work. I thought the meta data function always gets called regardless, it's just that it only tries to write infos when that field is found.

Second one is I pushed an silent little update to the FF bug with the tag field some time ago already.

  • Like 1
Link to comment
Share on other sites

Hi,

@MarcC Ideally having a check for data and populate fields would be a great idea. In my case my setup looks like this. As you can see there'll be scans from the YashicatMat that probably won't show anything because it records no data and I haven't written anything down for the shot :) .

mw-photoblog.jpgscreenshot_16.jpg

  • Like 2
Link to comment
Share on other sites

Pretty blown away by all the help! Horst, I'm excited to check out the module. Sorry for the late reply but I really appreciate this. Marty, great looking photo site and thanks for sharing the way it works. Congrats on being featured in the e-newsletter. :-)

Link to comment
Share on other sites

  • 2 years later...

Hi Gideon So,

unfortunately I haven't followed / used the Image Manager project since a long time. :(

But in the meantime there was an EXIF-module contribution from @nico. Maybe this is of help for you:

http://modules.processwire.com/modules/image-exif/

It adds an EXIF property to the image API call and let you retrieve all sort of EXIF informations.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...