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

iOS: Ti.Blob images from device (via Ti.UI.View#toImage()) would report dimensions in points, not pixels

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 9.0.3
    • Fix Version/s: Release 9.1.0
    • Component/s: iOS
    • Labels:
    • Story Points:
      5

      Description

      On Android, if we generate a Ti/Blob image from calling Ti.UI.View#toImage(), it reports width/height/size properly.

      On iOS, it will report width and height in points, not pixels. size is therefore also incorrect.

      Say we have a 10px x 10px view rendered to image on a 3x scale device. The blob will report width of 3, height of 3 and size of 9. The device will report density factor of 3. So naively multiple by that still gives us wrong values (of 9, 9, 81 respectively instead of 10, 10, 100).

      UIImage holds a scale value for cases like this and we should multiply width/height by that on iOS to get true pixel values. (Doing so in this case we actually do end up with 10, 10, 100 because presumably the image scale is recorded as something like 3.3333?)

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              cwilliams Christopher Williams
              Reviewer:
              Jan Vennemann
              Tester:
              Samir Mohammed
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration