sambecker / exif-photo-blog

Photo blog, reporting 🤓 EXIF camera details (aperture, shutter speed, ISO) for each image.
https://photos.sambecker.com
685 stars 108 forks source link

Image upload fails due to invalid time value #63

Closed redac closed 5 months ago

redac commented 5 months ago

Hi @sambecker! Using the latest version of the project, I'm having the same issue encountered in #37 & #31.

Here's the image I was trying to upload

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at E (/var/task/.next/server/chunks/3029.js:179:5539)
    at h (/var/task/.next/server/chunks/3029.js:179:5606)
    at m (/var/task/.next/server/chunks/8271.js:1:4300)
    at i (/var/task/.next/server/chunks/8271.js:1:5758)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async x (/var/task/.next/server/app/admin/uploads/[uploadPath]/page.js:1:4242)

Thanks a lot!

sambecker commented 5 months ago

Looks like that file has an empty string for the "taken at" time.

Just pushed a small update which makes the app more resilient to parsing empty strings.

Can you sync your fork and let me know if it works on your end?

Date time parsing will leverage existing behavior of using the upload time as the taken at time.

redac commented 5 months ago

That checks out since it is a film scan. Works wonderfully with the taken_at time being the time of the upload. Thanks again.