Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-4782

Ti.Blob imageAsCompressed function does not exist

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Invalid
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Labels:
    • Environment:

      OSX 10.12.2
      Xcode 8.2.1
      Titanium SDK 6.0.1.GA
      Appcelerator Studio, build: 4.8.1.201612050850

      Description

      The Ti.Blob imageAsCompressed function does not appear to exist. I get "undefined" is not a function when trying to run it.

      Some code:

       
      compressImage: function(original) {
          var image = this.resizeImage(original);
          return image.imageAsCompressed(.75);
        },
        resizeImage: function(original) {
          if (original.width < maxWidth && original.height < maxHeight) {
            return original;
          }
          
          var aspectRatio = original.width / original.height;
          if (original.width <= original.height) {      
            return original.imageAsResized(aspectRatio * maxHeight, maxHeight);  
          }
          
          return original.imageAsResized(maxWidth, maxWidth / aspectRatio);
        },
      

      The original is response data from an http call. Note that the imageAsResized works fine. Since that should be returning a blob I would expect the imageAsCompressed function to work as well. I have been using Ti ImageFactory which does work, but wanted to see if the SDK function would be more efficient.

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              nthurston8 Nicholas Thurston
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code