-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config option to change the extension #131
base: master
Are you sure you want to change the base?
Conversation
25f563b
to
832e2a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good point. But if changeExtension
is false, the image converted by ImageMagick
causes MIMEType mismatch and image has broken, isn't it?
To keep consistency, I think you should also stop to convert image if changeExtension
is false.
bin/configtest
Outdated
@@ -179,6 +179,7 @@ var reset = '\u001b[0m'; | |||
stdout.write("[Same directory]"); | |||
} | |||
stdout.write(reset + "\r\n"); | |||
stdout.write(magenta + " Change extension: " + reset + !!changeExtension + "\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use Boolean(changeExtension)
Will change to How will it bother ImageMagick? He gets the raw data (see aws-lambda-image/lib/ImageResizer.js Line 34 in 9924bc1
|
Yes, ImageMagick doesn't have to know. If this is clearly, let's merge it. |
It should be fine, the type of the data (chosen by A browser downloading the image from S3 and showing it in an The only problem is if someone takes the S3 file and determines the file type according to the extension (which is a bad way to determine), in this case the package's user can use the Can you check why travis is stuck? I think there might be one failing test I need to fix before this is merged. |
Changing you app to make it expect change of the extension would seem to be more reasonable approach for me :) |
@kdybicz that would mean the lambda needs to update the DB (Mongo in my case). I actually have all images uploaded as "image.jpg" (to different directories) and I prefer it not to change ever 😄 |
d0c2794
to
1398d76
Compare
@ysugimoto I've been wrapping my brain around these failures and I have no clue 😢 I can barely run the test suite, I have to disable eslint and then I get a lot of |
@odedniv I saw Travis's log, some assertions are failed. And eslint error reports in your environments? An error of Anyway, you can run a single test to install
|
If we passed the tests, let's merge this |
This is the output I get from running the tests:
It doesn't make sense on many levels... for example the file contains more than 4 tests |
Hmmmmm... So, I'm using node v6.9.1 on macOS. Please let me know about your environment? |
Didn't work... Well if it succeeds for you I guess it can be merged :) |
1398d76
to
57b515e
Compare
57b515e
to
da66ec5
Compare
In previous versions the filename remained the same across backups/reduces/resizes.
In commit f9eed2f the code was changed to change to the file type's extension, breaking my app (when I updated). I don't expect the filenames to change (even if they are wrong).
Made it optional with a config option
changeExtension
, that defaults to false (the original behavior). I know it's back and forth on 'breaking changes' but hopefully there are more people who haven't yet updated than there are people who have (or had to revert to the old code after finding it breaks their app).