waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
448 stars 68 forks source link

WebP support? #68

Closed nicosomb closed 1 year ago

nicosomb commented 1 year ago

Hello,

Is that possible to add WebP support to your great tool?

waschinski commented 1 year ago

While technically the library in use (libvips) can handle WebP and a variety of other formats, the project is pretty much hard-coded to only work with jpeg.

I would need to take a deeper look but files like photo_filter.rb, rename_photos.rb etc would need to implement code depending on the image format by the file's extension.

waschinski commented 1 year ago

Good news, months ago I already played around with replacing Exifr with Exiftools which supports more than jpeg and tiff files. I dropped a WebP file in the dev tree and it worked right away. :) Going to prepare a merge after some more testing.

waschinski commented 1 year ago

WebP and PNG should now be working in 1.5.0.

nicosomb commented 1 year ago

@waschinski website building seems to be longer than before. But it works se well 🎉

waschinski commented 1 year ago

@waschinski website building seems to be longer than before. But it works se well 🎉

Thanks for the feedback, great to hear it works well so far. :)

I have seen some rendering issues on the demo page but nothing I can reproduce consistently on that remote side nor locally. If you happen to come across something strange please let me know.

nicosomb commented 1 year ago

Before the new features, the build lasted 20 seconds. Now, it lasts 100 seconds.

waschinski commented 1 year ago

That's a pretty huge increase. My guess is that exifr was a lot faster than exiftool but I would need to get some confirmation on that.

waschinski commented 1 year ago

The exiftool website is mentioning performance and ways to improve it. I will try looking into options provided by the [exiftool.rb](https://github.com/exiftool-rb/exiftool.rb.