Merge pull request #3241 from silentnoodlemaster/v3.0
Add option to use lossless webp format
This commit is contained in:
commit
bc1fa86823
14 changed files with 15 additions and 14 deletions
|
|
@ -73,7 +73,8 @@ public abstract class MapType {
|
|||
FORMAT_WEBP("webp", 85, ImageEncoding.WEBP),
|
||||
FORMAT_WEBP90("webp-q90", 90, ImageEncoding.WEBP),
|
||||
FORMAT_WEBP95("webp-q95", 95, ImageEncoding.WEBP),
|
||||
FORMAT_WEBP100("webp-q100", 100, ImageEncoding.WEBP);
|
||||
FORMAT_WEBP100("webp-q100", 100, ImageEncoding.WEBP),
|
||||
FORMAT_WEBPL("webp-l", 85, ImageEncoding.WEBP);
|
||||
String id;
|
||||
float qual;
|
||||
ImageEncoding enc;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class ImageIOManager {
|
|||
fos.close();
|
||||
// Run encoder to new new temp file
|
||||
File tmpfile2 = File.createTempFile("pngToWebp", "webp");
|
||||
String args[] = { core.getCWEBPPath(), "-q", Integer.toString((int)fmt.getQuality()), tmpfile.getAbsolutePath(), "-o", tmpfile2.getAbsolutePath() };
|
||||
String args[] = { core.getCWEBPPath(), fmt.getID().endsWith("-l")?"-lossless":"", "-q", Integer.toString((int)fmt.getQuality()), tmpfile.getAbsolutePath(), "-o", tmpfile2.getAbsolutePath() };
|
||||
Process pr = Runtime.getRuntime().exec(args);
|
||||
try {
|
||||
pr.waitFor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue