File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3132,6 +3132,7 @@ protected boolean saveImageIO(String path) throws IOException {
31323132 ImageWriter writer = null ;
31333133 ImageWriteParam param = null ;
31343134 IIOMetadata metadata = null ;
3135+
31353136 if (extension .equals ("jpg" ) || extension .equals ("jpeg" )) {
31363137 if ((writer = imageioWriter ("jpeg" )) != null ) {
31373138 // Set JPEG quality to 90% with baseline optimization. Setting this
@@ -3143,12 +3144,16 @@ protected boolean saveImageIO(String path) throws IOException {
31433144 param .setCompressionQuality (0.9f );
31443145 }
31453146 }
3146- if ((writer = imageioWriter ("png" )) != null ) {
3147- param = writer .getDefaultWriteParam ();
3148- if (false ) {
3149- metadata = imageioDPI (writer , param , 100 );
3147+
3148+ if (extension .equals ("png" )) {
3149+ if ((writer = imageioWriter ("png" )) != null ) {
3150+ param = writer .getDefaultWriteParam ();
3151+ if (false ) {
3152+ metadata = imageioDPI (writer , param , 100 );
3153+ }
31503154 }
31513155 }
3156+
31523157 if (writer != null ) {
31533158 BufferedOutputStream output =
31543159 new BufferedOutputStream (PApplet .createOutput (file ));
You can’t perform that action at this time.
0 commit comments