-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hello there @jrstrunk,
I've been using the package for a bit with good success, one thing that surprised me is that filename extensions are added to the file path when writing a file, I ended up with duplicate extensions like .webp.webp because I was appending them myself.
I would like to use the path the image was written to in the rest of my application, so I'm looking for a way to either be able to set the complete path explicitly, or receive it in return from the write function, because right now I have to do this:
let target_path = "wobble"
use Nil <- result.try(image.write(
image,
to: target_path,
in: image.WebP(quality: 80, keep_metadata: False),
))
let actual_path = target_path <> ".webp"
Ok(actual_path)Which I find a little sub-optimal, because I don't really have assurance that the actual path I'm storing is correct (what if it happens to be .WEBP instead of .webp, or I change the format and forget to change that part).
Would like to hear your thoughts on this, my suggestion would be to return the constructed path to the image from the write function instead of Nil, would you accept a PR for that?