Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16882

iOS: Converting a blob into a valid image does not maintain dimensions

    Details

    • Story Points:
      3
    • Sprint:
      2014 Sprint 15 SDK, 2014 Sprint 17 SDK

      Description

      Issue description

      Looking for a cross-platform way to create image thumbnail files asynchronously. Titanium is able to read an image file asynchronously into a buffer and then a blob. If we assign that blob to the image property of an ImageView, it displays as I expect. However, the blob is not recognised as an image by any of the Ti.Blob.image* methods. The blob has a mime type of "application/octet-stream" and a height and width of 0. Meanwhile Android is able to get height and width properly.

      Steps to reproduce
      1. Launch sample app. You can see that the fishImage ImageView loads its image directly from a file path in its "image" property.
      2. earthImage is loaded in index.js asynchronously using a file stream. Once the file contents are read completely, they are assigned to the image property of $.earthImage.
      3. Notice, the blob you get as a result of "earthBuffer.toBlob()" can't be used for any other image manipulation (e.g. creating thumbnails). It doesn't have a valid mimeType, height, or width on iOS.

      E.G.

      $.earthImage.image = earthBuffer.toBlob();
      Ti.API.info( $.earthImage.image.height + ' . '+ $.earthImage.image.width + ' . '+ $.earthImage.image.mimeType);
      

      Android

      04-24 15:11:03.812: I/TiAPI(28395):  1600 . 2560 . application/octet-stream
      

      iOS

      [INFO] :   0 . 0 . application/octet-stream
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                egomez Eduardo Gomez (Inactive)
                Reviewer:
                Pedro Enrique (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-18655
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration