# Rmagick get date picture taken

**URL:** <https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698>\
**Category:** Ruby\
**Created:** [September 4, 2007, 3:17am UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698 "2007-09-04T03:17:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [September 4, 2007, 3:17am UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698/1 "2007-09-04T03:17:33Z")

</div>

I want to make a program to rename pictures based on the date and time  
they were taken. How do I get the date (and time) a picture was taken?

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [September 4, 2007, 5:21am UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698/2 "2007-09-04T05:21:47Z")

</div>

On 9/4/07, Jonathan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want to make a program to rename pictures based on the date and time  
> they were taken. How do I get the date (and time) a picture was taken?

Unless the camera you were using has support for Exif metadata tags  
and has been properly set up to generate them you’re basically SOL. If  
your camera has such tagging enabled, apparently RMagick has support  
for reading Exif tags if they’re present, and there’s another library:

[http://rubyforge.org/projects/exifr](http://rubyforge.org/projects/exifr)

capable of reading this data if it exists.

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [September 4, 2007, 6:24am UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698/3 "2007-09-04T06:24:27Z")

</div>

Dido S. wrote:

> On 9/4/07, Jonathan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I want to make a program to rename pictures based on the date and time  
> > they were taken. How do I get the date (and time) a picture was taken?
> 
> Unless the camera you were using has support for Exif metadata tags  
> and has been properly set up to generate them you’re basically SOL. If  
> your camera has such tagging enabled, apparently RMagick has support  
> for reading Exif tags if they’re present, and there’s another library:
> 
> [http://rubyforge.org/projects/exifr](http://rubyforge.org/projects/exifr)
> 
> capable of reading this data if it exists.

Yes, the data is there. I just want to know what method to use to  
access it in Ruby. The Rmagick documentation is just not very helpful  
on that.

I think I will try exifr, it looks like it will probably be easier to  
use.

thanks

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [September 4, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698/4 "2007-09-04T13:24:49Z")

</div>

Jonathan D. wrote:

> I want to make a program to rename pictures based on the date and time  
> they were taken. How do I get the date (and time) a picture was taken?

[http://www.simplesystems.org/RMagick/doc/image2.html#get\_exif\_by\_entry](http://www.simplesystems.org/RMagick/doc/image2.html#get_exif_by_entry)

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [September 4, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/rmagick-get-date-picture-taken/113698/5 "2007-09-04T20:12:19Z")

</div>

Tim H. wrote:

> Jonathan D. wrote:
> 
> > I want to make a program to rename pictures based on the date and time  
> > they were taken. How do I get the date (and time) a picture was taken?
> 
> [RMagick 1.15.0: class Image (instance methods, part 2)](http://www.simplesystems.org/RMagick/doc/image2.html#get_exif_by_entry)

Thankee, just what I was looking for 😃
