# Generate meta-data for image automatically (like Modified-Date, filename, etc.)?

**URL:** <https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598>\
**Category:** Questions\
**Tags:** v2\
**Created:** [March 25, 2015, 2:20pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598 "2015-03-25T14:20:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![R4ttlesnake](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@R4ttlesnake](https://forum.getkirby.com/u/R4ttlesnake)\
**Post date:** [March 25, 2015, 2:20pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/1 "2015-03-25T14:20:52Z")

</div>

Hello, I would like to update the meta-information of my uploaded images automatically without having to fill in the data in the Panel.

Let’s say _test-image.jpg_ was last time modified _25/03/2015, 15:18_. Can I get its timestamp like file()-\>modified(), convert it to a time (with _date(“d/m/Y, H:i”, $timestamp)_) and fill it into the test-image.jpg.txt automatically?

Thanks!

---

<div class="post-metadata">

**Author:** ![jbeyerstedt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jbeyerstedt/32/3976_2.png) [@jbeyerstedt](https://forum.getkirby.com/u/jbeyerstedt)\
**Post date:** [March 25, 2015, 4:32pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/2 "2015-03-25T16:32:35Z")

</div>

Why do you want to store this in the image metadata file?  
If you don´t want to write the code to convert the timestamp into text every time, you can create a plugin for it.  
Or do you want to have some exif information from the image, like the creation timestamp?

I don´t understand what information you want to have.

---

<div class="post-metadata">

**Author:** ![R4ttlesnake](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@R4ttlesnake](https://forum.getkirby.com/u/R4ttlesnake)\
**Post date:** [March 25, 2015, 5:15pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/3 "2015-03-25T17:15:50Z")

</div>

Basically, I need to know, when the image was taken. Does every image provide a exif-information? So, yes, I forgot about the exif stuff. Does every image provide that?

How could I get the creation timestamp into the meta.txt?

Thanks!

---

<div class="post-metadata">

**Author:** ![jbeyerstedt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jbeyerstedt/32/3976_2.png) [@jbeyerstedt](https://forum.getkirby.com/u/jbeyerstedt)\
**Post date:** [March 25, 2015, 6:57pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/4 "2015-03-25T18:57:04Z")

</div>

I wonder why you would write it to the metadata file?  
Isn´t it enough to get it “live” from the file? See [http://getkirby.com/docs/cheatsheet#exif](http://getkirby.com/docs/cheatsheet#exif) for the documentation of the exif data functions.

Every camera I know adds a creation timestamp to every image. It can be lost if you edit an image, but most of the software should preserve the meta information. Simply try it.

---

<div class="post-metadata">

**Author:** ![jbeyerstedt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jbeyerstedt/32/3976_2.png) [@jbeyerstedt](https://forum.getkirby.com/u/jbeyerstedt)\
**Post date:** [March 25, 2015, 7:54pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/5 "2015-03-25T19:54:49Z")

</div>

But to your original question: I don´t know how to save some text to the images meta file in a simple way. There is no standard way to achieve this and I thinks that it is not necessary to write information to this file that you would get from the image as well. But this is my opinion.

---

<div class="post-metadata">

**Author:** ![andi242](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/andi242/32/3132_2.png) [@andi242](https://forum.getkirby.com/u/andi242)\
**Post date:** [March 25, 2015, 8:56pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/6 "2015-03-25T20:56:24Z")

</div>

I ran across something similar today. But it was just because there was no exif data available in the .jpg.

I tried to try & catch the error, but there was no way to handle the error.  
would a manual .jpg.txt help?  
If the image containts exif, it’s just fine to extract them with the Kirby functions. But if there is no exif available, scripts keep crashing.

---

<div class="post-metadata">

**Author:** ![R4ttlesnake](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@R4ttlesnake](https://forum.getkirby.com/u/R4ttlesnake)\
**Post date:** [March 26, 2015, 3:14pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/7 "2015-03-26T15:14:16Z")

</div>

Okay, indeed, I was thinking some steps too complicated, instead of just fetching the data from the file directly… But thanks for that!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:04pm UTC](https://forum.getkirby.com/t/generate-meta-data-for-image-automatically-like-modified-date-filename-etc/598/8 "2025-02-06T17:04:37Z")

</div>

Archived on February 6, 2025, 5:04pm UTC


