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

Windows: Ti.Blob.imageAs* methods crash the application when using a blob that does not represent an image

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.3.0
    • Fix Version/s: Release 5.4.0
    • Component/s: Windows
    • Labels:
    • Environment:

      Windows 10 Pro
      Visual Studio 2015 Community Update 2
      Appc Core: 5.3.0-46
      Appc NPM: 4.2.5-5
      Ti SDK: 5.3.0.v20160523083840

    • Story Points:
      3
    • Sprint:
      2016 Sprint 11 SDK

      Description

      Description

      When using the Ti.Blob.imageAs methods if they are given a blob that does not represent an image then the application will crash, based off the documentation and other platforms they should not crash but just return null docs

      var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
      file.write('hi');
      var win = Ti.UI.createWindow({
      	backgroundColor: 'black'
      });
      var btn = Ti.UI.createButton({
      	title: 'resized',
      	top: 10
      });
      btn.addEventListener('click', function(){
      	var file2 = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
      	var text = file2.read();
      	var resized = text.imageAsResized(25, 25);;
      });
      var btn2 = Ti.UI.createButton({
      	title: 'cropped',
      	top: 75
      });
      win.add(btn);
      win.open();
      

      Steps to reproduce

      1. Using the code above build to a windows device or emulator

      Actual result

      Application will crash

      Expected result

      Application should not crash, methods should return null

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                eharris Ewan Harris
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration