jordanhandy / obsidian-cloudinary-uploader

An uploader for Obsidian to Cloudinary
https://jordanhandy.github.io/obsidian-cloudinary-uploader/
MIT License
25 stars 3 forks source link

Add f_auto option to URL #4

Closed charlesroper closed 1 year ago

charlesroper commented 1 year ago

Firstly, thanks for this plugin - it's so handy.

I've got a feature request. I find that for every image I add to Obsidian/Cloudinary, I end up adding f_auto to the URL. More often than not, this results in an avif as a response, which is great. So my request is: would it be possible to either specify, or default to, f_auto mode?

More about f_auto here: https://cloudinary.com/documentation/video_optimization#automatic_format_selection_f_auto

Many thanks.

jordanhandy commented 1 year ago

Hi @charlesroper, thanks for the feedback. Much appreciated.

Regarding the request, I'll take a look into this over the weekend and maybe take a crack at it.

No ETA currently

charlesroper commented 1 year ago

Great, thanks!

jordanhandy commented 1 year ago

Great, thanks!

Hi @charlesroper, Latest build should have this toggle for you.

From reading the link you sent, it's a URL edit only? Let me know if this is what you were looking for

charlesroper commented 1 year ago

Just updated. It works perfectly, thank you!

Yes, it's just a URL edit. Cloudinary smartly delivers other formats if the browser supports them and the size is smaller than the original. You can tell it's working by opening devtools Network tab and looking at the image format response. It'll usually respond with an AVIF in Obsidian (on Windows at least - not tried other platforms)

E.g. this PNG screenshot downloads for me as an AVIF:

It's showing a JPG that has downloaded as an AVIF in the Network panel in Obsidian.

(if a PNG is already tightly optimised, it'll still return the original PNG)

jordanhandy commented 1 year ago

Thanks for the info. Very interesting. Glad it's working for you.