Passing extra image data (EXIF date) to the browser upon adding an image in a form I am currently using EXIF module to import the DateTimeOriginal tags but it does not display the tag in the form right after uploading the image and I would really prefer to see that info while still filling the form as it affects what I should fill in manually.

I noticed that the image size is displayed next to the image file name after the image has been uploaded, found the code in core/modules/image/image.field.inc that basically hard codes what will be rendered to be sent back to the client in an ajax response. I added a call to exif_read_data() right there and appended my DateTimeOriginal tag after the file size and it works fine!

But surely editing core files is not the right way to do that - there must be some hook to use but I can't seem to figure out which one. Besides I would prefer my tag (and maybe other info like image width and height etc) to be neatly accessible via js on the client to update other fields in the form dependent on it.

I would appreciate any advice on what is the right place to put that code.
hook_preprocess_image_widget() worked for me.