nativescript-community / ui-image

Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.
Apache License 2.0
36 stars 9 forks source link

setting roundCornor cause image flip vertically in IOS #7

Closed gogoout closed 5 years ago

gogoout commented 5 years ago

Which platform(s) does your issue occur on?

iOS, so far only tested on emulator. Android is fine.

Please, tell us how to recreate the issue in as much detail as possible.

<NSImg row = "0" colSpan = "2"
         [src] = "product?.images[0]?.thumb" class = "thumb m-b-5"
         placeholderImageUri = "~/assets/placeholder.png"  failureImageUri = "~/assets/placeholder.png"
         stretch = "aspectFill"
         roundTopLeft = "true" roundTopRight = "true"
         roundBottomLeft = "true" roundBottomRight = "true"
         roundedCornerRadius = "12"
         fadeDuration = "500"
         [height] = "imageHeight|| (product|waterfallThumbHeight:cardWidth)">
  </NSImg>

I have tried different combination on roundTopLeft etc.. Seems setting those attributes will just cause the image flip upside down.

Manually comment the following code under solve the problem for me.

if (this.roundBottomLeft || this.roundBottomRight || this.roundTopLeft || this.roundTopRight) {
   ....
  // comment this
  // transformers.push(SDImageFlippingTransformer.transformerWithHorizontalVertical(false, true));

I can create a demo if it's needed.

farfromrefug commented 5 years ago

@gogoout strange. Just tested in the demo app and it works. Can you test it? There is a "roundedcornerradius" example there.

Also can you find the version of SDWebImage you are using ? (should be in the build log)

farfromrefug commented 5 years ago

@gogoout actually found it It s a bug in SDWebImage https://github.com/SDWebImage/SDWebImage/releases

Indeed need to remove the transform and force the plugin to use SDWebImage > 5.0

gogoout commented 5 years ago

@farfromrefug That's great. Thanks for the quick response.

farfromrefug commented 5 years ago

@gogoout fixed and published!