Giter Club home page Giter Club logo

image-resizer's People

Contributors

ernestopye avatar jgillman avatar jimmynicol avatar johnrees avatar jrowny avatar kbighorse avatar lasconic avatar psugihara avatar teohhanhui avatar wjordan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

image-resizer's Issues

Needs better error handling for NODE_ENV value

My NODE_ENV was set to "dev" and thus produced a not-so-obvious error in heroku

Error: Cannot find module './src/config/dev'

^ that did not mean too much to me initially.

The stack trace was even less informative then that. I suggest a try catch with a message about what valid values the NODE_ENV can be set to... and perhaps it could default to using the development.js file with a warning if no matching file can be found.

Thanks!

Issue with cloudfront/s3 url

I've edit the environment to include

EXTERNAL_SOURCE_VF='http://www.cfmedia.vfmleonardo.com/'

However, whenever I try loading an image, i got 500 error, The specified key does not exist. (looks like the original is on cloudfront/s3).

mydomain.com/evf/imageRepo/4/0/55/359/440/ROY.44A_H.jpg

Example of said image url: http://www.cfmedia.vfmleonardo.com/imageRepo/4/0/55/359/440/ROY.44A_H.jpg

I do not have control over this image / url.

Crop cut "Bad extract area"

Sharp returns a "Bad extract area" when extracting "out of bounds" portions of images. This means that requesting a bad cut makes the server return a 500 code. This is not really ideal for a production environment.

Wouldn't it be better to simply return a sensible default (like ignoring the crop or switching to a different crop mode) while issuing a 400 (as in a "Bad request" was made)?

Setting external source as a default source?

Thanks for this fork! It's great!

Is there an easy way to set an external source (public read only access to an Azure blob storage location in my case) as the DEFAULT_SOURCE?

I currently have have an environment EXTERNAL_SOURCE_FOO = "https://mylocation.blob.core.windows.net" and this works great but that means I would need to append efoo at the front of every url like http://localhost/efoo/path/to/my/photo.png

I tried modify DEFAULT_SOURCE = S3 to DEFAULT_SOURCE = FOO but visiting http://localhost/path/to/my/photo.png doesn't work

Production ready ?

Hey @teohhanhui,

Good job on this fork ! It looks like https://github.com/jimmynicol/image-resizer isn't maintained anymore..
I just wanted to get some feedback from you about this library, are you using it in production ?
Any issue known about using it ?
I'm still wondering if I should use on the fly resize with image-resizer or use AWS lambda to automatically convert my images.

Would appreciate some of your wisdom :)

Thanks

Convert PNG with alpha to JPG assumes black background

Trying to convert the following image to JPG will send back a completely black image.
score_0 1

I'm tempted to add something like the following in image.js. Any advice?

if (image.outputFormat === 'jpeg') {
      r.background('#FFFFFF').flatten();
    }

Unable to resolve .gif file

image-resizer_1  | [resizer] new stream created! 
image-resizer_1  | [resizer] s3 - 80ms
image-resizer_1  | [resizer] identify: no identify 
image-resizer_1  | [resizer] resize error Error: Unsupported output format gif 
image-resizer_1  | [resizer] resize - 15ms
image-resizer_1  | [resizer] Error: Unsupported output format gif 
image-resizer_1  | GET /h126-w225-cfill/02cc194d-25dc-4f36-b09b-8772c56b6ffb.gif.webp 500 115.418 ms - -

Retrieve original does not work for images in root path that start with modifier letter

The bug:
A call to http://<url>/some/path/cistf72.jpg works fine.
A call to http://<url>/cistf72.jpg does not.

Some investigating revealed that the parse method in modifiers.js calls parseModifiers even when no path is provided. Since the first letter of the filename above is a modifier, it will set the hasModStr variable to true, which in turn cases trouble in image.js.

The end result is that images that (1) are in the root path and (2) start with a filename w/modifier string can never be retrieved by original.

Resize the 404 image

Just wondering if this should be working or not but I've added a 404 picture that I'd like to return in the requested size.

Should that technically be working as I only receive my original size.

Would be great if that would work!

Add ability to set the User-Agent for external sources

It would be very useful to be able to set the user-agent for external sources. Since image-resizer doesn't forward the query parameters and it's best used on Heroku (where there is no fix IP), it's not easy to know on the origin "who" called and make the difference between legitimate and non legitimate calls for example.

Unsupported output format "gif"

I have an image which is jpg but somehow when i use external source to resize it, I got Unsupported output format "gif"

The image url is

http://pix3.agoda.net/hotelimages/694/69405/69405_14040308360018949836.jpg?s=312x

env EXTERNAL_SOURCE_TEST='http://pix3.agoda.net and access it via

example.com/etest/hotelimages/694/69405/69405_14040308360018949836.jpg?s=312x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.