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

Android: ImageView sometimes loads wrong image due to hash code collision

    Details

    • Story Points:
      7
    • Sprint:
      2021 Sprint 20

      Description

      Summary:
      For android, Titanium takes wrong picture if it has name "G1.png" and "FP.png" (waa, I know this sounds strange, but when I change image names to G_1.png and F_P.png corresp., it works OK)

      Alloy view:

      <ImageView id="aa" borderWidth="1" borderColor="red" width="50" height="50" image="app://G1.jpg"/>
      <Label>-- 95_GP --</Label>
      <ImageView id="bb" borderWidth="1" width="50" borderColor="green" height="50" image="app://FP.jpg"/>
      </View>

      please also take a look to attachments (how it looks in android/iphone plus Titanium Alloy project to repro)

      Cause:
      This is due to hash code collision when fetching the image from Titanium's image cache. It ends up grabbing the wrong image.

        Attachments

        1. 2014-11-07_14-51-16.png
          2014-11-07_14-51-16.png
          49 kB
        2. 2014-11-07_14-57-24.png
          2014-11-07_14-57-24.png
          50 kB
        3. bad_images_app.zip
          5.77 MB
        4. FP.jpg
          FP.jpg
          28 kB
        5. G1.jpg
          G1.jpg
          44 kB
        6. ImageHashTest.js
          0.2 kB

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              yurys Yury Skaletskiy
              Reviewer:
              Gary Mathews
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration