cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darryl Champagne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-1700) Exif data corrupted on Android loading photos from Gallery
Date Fri, 04 Jan 2013 05:12:12 GMT

     [ https://issues.apache.org/jira/browse/CB-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Darryl Champagne updated CB-1700:
---------------------------------

    Attachment: CameraExif.patch

Since the formatting was not preserved in the comment, here is the patch I used.  I would
suggest recreating the change, rather than actually attempting to apply the patch.
                
> Exif data corrupted on Android loading photos from Gallery
> ----------------------------------------------------------
>
>                 Key: CB-1700
>                 URL: https://issues.apache.org/jira/browse/CB-1700
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Samsung Galaxy SII
>            Reporter: Darryl Champagne
>            Assignee: Simon MacDonald
>         Attachments: CameraExif.patch
>
>
> Source and Target filenames are reversed in CameraLauncher.java when returning a picture
from the gallery that requires resizing. 
> Exif data is being read in from the resized image (around line 433, in onActivityResult):
>     if (this.encodingType == JPEG) {
>         exif.createInFile(resizePath);
>         exif.readExifData();
>         rotate = exif.getOrientation();
>     }
> And being written back to the original file, rather than the resized file that is actually
returned (around line 446):
>     // Restore exif data to file
>     if (this.encodingType == JPEG) {
>         exif.createOutFile(FileUtils.getRealPathFromURI(uri, this.cordova));
>         exif.writeExifData();
>     }
> ...
>     this.callbackContext.success("file://" + resizePath + "?" + System.currentTimeMillis());
> This means that the almost nonexistent EXIF data in the output file gets written to the
original file (usually doing nothing), and the valid data is not returned in the resized file.
 The inFile should be imagePath (or recreated), and the outfile should be resizePath.
> The sending filename back from the Camera appears to have a similar issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message