WordPress.org

Forums

[resolved] [Plugin: NextGEN Gallery] Get files to import from folder with the creation date (2 posts)

  1. drewdogcomputers
    Member
    Posted 2 years ago #

    hey,
    So I'm importing some files that need their creation dates (an exif tag)
    I tried modifying the add_images function in /admin/functions.php with the code:
    // save it to the database
    $image = $picture;
    $exif = exif_read_data($image, 0, true);

    $dto = $exif['EXIF']['DateTimeOriginal'];

    $dt = explode(' ',$dto);
    $ds = str_replace(':', '-', $dt[0]);
    $da = $ds.' '.$dt[1];
    if ($da) {
    $imagedate = $da;
    }

    $pic_id = nggdb::add_image( $galleryID, $picture, '', $alttext, $imagedate );

    It still imports the files with what much be the current date and time, any ideas?

  2. drewdogcomputers
    Member
    Posted 2 years ago #

    Haha! Nevermind, it works as-is, my test data didn't have the metadata I was looking for with this code.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.