Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It would actually be different configurations per image, see this example:

http://cropper.onefinestay.com/s3NY9Z5QncGSnphA8QhOStz36wQ=/...

The segment immediately after the hostname is the signed part, which is generated based on all the other parameters (ie quality, dimensions, crop coordinates and source image url). If you change any part of the URL, the server will return a 404. There's no way of providing a set of client-side rules for how to generate the URLs for the different size images, without leaking our secret key. An option would be for the entire URL to be the configuration, but then all you've achieved is moving the config out of data attributes and into javascript config objects.

Essentially, this is what we're doing: https://gist.github.com/AndrewIngram/7871392



Oh that's an interesting approach; glad you coined it :-)

Could you create another Gist with how you would see your URL built with Imager? And ping @oncletom in it.

Maybe something like

``` http://cropper.onefinestay.com/{secret_key}=/80x19:4253x2801... ```

Thanks :-)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: