cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvasabi <...@git.apache.org>
Subject [GitHub] cordova-plugin-file pull request: Reading a slice of an asset from...
Date Tue, 17 Mar 2015 15:45:18 GMT
GitHub user vvasabi opened a pull request:

    https://github.com/apache/cordova-plugin-file/pull/105

    Reading a slice of an asset from photo library on iOS always gets the full file

    When reading a file from photo library, `file.slice()` does not work. Consider this code:
    
    ```
    resolveLocalFileSystemURL('assets-library://asset/asset.JPG?id=FILE-UUID&ext=JPG',
function(fileEntry) {
      fileEntry.file(function(file) {
        var reader = new FileReader();
        reader.onloadend = function(event) {
          console.log(event.target.result.byteLength);
        };
        reader.readAsArrayBuffer(file.slice(100, 200));
      });
    });
    ```
    
    The expected output is 100, but instead it is the full file size.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/70mainstreet/cordova-plugin-file master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file/pull/105.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #105
    
----
commit 4229f3659ea99ec7969cb45034fdaa00b013db84
Author: Brad Chen <brad5620732@hotmail.com>
Date:   2015-03-17T15:36:19Z

    Correctly return a slice of an asset, when start and end are specified for CDVAssetLibraryFilesystem.readFileAtURL().

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message