-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allow for cropping transparent true color pngs #1878
Conversation
@@ -37,9 +37,15 @@ class S3(credentials: AWSCredentials) { | |||
} | |||
|
|||
private def getContentDispositionFilename(image: Image, charset: CharSet): String = { | |||
|
|||
val extension = image.source.mimeType match { | |||
case Some("image/jpeg") => "jpg" |
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.
Might be better to identify png specifically here and fail in the "other" case.
👍 apart from comments. Let me know if you want to talk through the enum/case class stuff. |
9a3a04a
to
5081fbe
Compare
cb95383
to
b8703b2
Compare
@NickPapacostas This has now been updated and is ready for review |
file: File <- ImageOperations.appendMetadata(strip, metadata) | ||
|
||
//Before apps and frontend can handle PNG24s we need to pngquant PNG24 master crops | ||
optimisedFile = if (colourType == "True Color" || colourType == "True Color with Alpha") { |
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.
Could it ever be True Color
? I thought these would go through PNGs-that-should-really-be-JPGs route... Not a problem as such, though.
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.
Yes, I think I forgot all about that. I'll double check and fix it.
Nice job! A few little cleanups, then 👍 |
Allow cropping pngs with transparency. Optimised the generated assets with pngquant.
Getting this working working locally requires installing pngquant. If installing pngquant with brew, create a symlink from /usr/local/bin/pngquant to /urs/bin/pngquant