GitToTheHub commented on PR #868:
URL: 
https://github.com/apache/cordova-plugin-camera/pull/868#issuecomment-5127980610

   I think it's not ready to merge. Claude Sonnet 4.6 tells:
   
   ## What it does
   
   When loading a gallery image in DATA_URL format, instead of encoding the 
decoded bitmap directly (which loses EXIF), it saves to a temp file via 
outputModifiedBitmap (which copies EXIF), then reads it back and encodes to 
base64.
   
   ## Issues to address before merging
   
   - Resource leaks — fileStream and buffer are never closed. Should use 
try-with-resources:
   ```java
   try (InputStream fileStream = ...; ByteArrayOutputStream buffer = ...) { ... 
}
   ```
   - Excessive memory allocation — new byte[MB * 4] allocates 4 MB per call. A 
standard 8–16 KB buffer is idiomatic.
   - Temp file not cleaned up — outputModifiedBitmap writes a file that is 
never deleted after reading back.
   - e.printStackTrace() — Should use the existing LOG.e(TAG, ...) pattern used 
throughout this codebase.
   - Style — js_out uses snake_case in Java; jsOut is conventional
   - JPEG re-compression — Saving the bitmap and reading it back applies 
another round of lossy JPEG compression, degrading image quality. The EXIF 
could be applied directly from the original uri without re-encoding the bitmap.
   - Checklist — No tests run or added; the issue link uses "should fix" which 
won't auto-close #867 (needs Fixes #867 or Closes #867).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to