unpic icon indicating copy to clipboard operation
unpic copied to clipboard

Feature Request: Support for Self Hosted image manipulation server (Thumbor, Imgproxy, Imaginary)

Open imsus opened this issue 2 years ago • 16 comments

Please support the open source alternatives

Thumbor

Website: https://www.thumbor.org/ Github Repo: https://github.com/thumbor/thumbor

Imgproxy

Website: https://imgproxy.net/ Github Repo: https://github.com/imgproxy/imgproxy

Imaginary

Github Repo: https://github.com/h2non/imaginary

imsus avatar Mar 13 '23 02:03 imsus

Yeah, ipx too. What I want to do is introduce a more concept of a fallback transformer, which only handles transforms if it doesn't match a CDN transformer. I can take a lot of the logic out of the Vercel transformer. That would make it a lot easier to implement these.

ascorbic avatar Mar 13 '23 07:03 ascorbic

I'd also like to suggest my self-hosted OSS image servers Imageflow and ImageResizer; both have the same querystring command syntax.

https://docs.imageflow.io/querystring/introduction.html https://github.com/riapi/riapi https://github.com/imazen/imageflow https://github.com/imazen/imageflow-dotnet-server https://github.com/imazen/resizer

lilith avatar Mar 14 '23 16:03 lilith

+1 for imaginary.

Here is their API https://github.com/h2non/imaginary#http-api

rajeshg avatar Mar 23 '23 21:03 rajeshg

I'm thinking about writing a transformer for Imaginary. I've looked at some of the other transformers to get a feel for it. I wonder if you have any advice for how this process might look, since it will be using a custom domain and then going from unpic -> unpic-img which is my goal here.

kdevan avatar Apr 04 '23 17:04 kdevan

The trouble with most of these is that they use signed URLs, which we can't support

ascorbic avatar Apr 22 '23 16:04 ascorbic

The trouble with most of these is that they use signed URLs, which we can't support

can we expose a function to fetch signed URLs from the backend

sahidrahman404 avatar Jul 19 '23 01:07 sahidrahman404

You'd not be able to do that if you ever wanted to use this in the client, e.g. if you're using unpic-img

ascorbic avatar Jul 19 '23 09:07 ascorbic

I have implemented support for ipx. If anyone would like to add support for other self-hosted servers then I would suggest using that as an example

ascorbic avatar Oct 29 '23 20:10 ascorbic

Would you be open to adding support for imgproxy with unsigned URLs? It seems like setting the allowed sources can act as security measure and unpic could add the disclaimer it only works with unsigned URLs https://docs.imgproxy.net/configuration/options#IMGPROXY_ALLOWED_SOURCES

anthonyholmes avatar Apr 28 '24 20:04 anthonyholmes

Absolutely! Please do. I'd need an example host for the tests though.

ascorbic avatar Apr 29 '24 06:04 ascorbic

I can send you a couple links from my server unless you think that's a terrible idea

anthonyholmes avatar Apr 30 '24 02:04 anthonyholmes

That should be fine. You can add that as part of the PR if that's ok

ascorbic avatar Apr 30 '24 09:04 ascorbic

@ascorbic I've forked and created a provider integration for imgproxy utilising all the non pro features and using it in unsecure mode (unsigned). It passes all tests locally but the host I'm using is on my pretty underpowered VPS that i'm wanting to lock down to just one site and ideally not share.

Any suggestions how we can do this? I've not found any publicly accessible instances to use for tests

turnah avatar Jan 31 '25 12:01 turnah

@turnah do they have any examples in the imgproxy docs, or anything like that?

ascorbic avatar Jan 31 '25 15:01 ascorbic

@turnah do they have any examples in the imgproxy docs, or anything like that?

They do, but unfortunately they have a signature so would need the salt and key to make any changes to the url meaning they're off limits (https://docs.imgproxy.net/usage/signing_url)

turnah avatar Jan 31 '25 15:01 turnah

Incidentally, now that Unpic supports provider options, it could support signed URLs. It would of course still need a key.

ascorbic avatar Jan 31 '25 16:01 ascorbic