coil-kt / coil

Image loading for Android and Compose Multiplatform.

Home Page:https://coil-kt.github.io/coil/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Low quality of SVG icon if one of dimensions is wrap_content

Subuday opened this issue · comments

Describe the bug
If we use SVG decoder and load an SVG into ImageView with specific parameters(one dimension is wrap_content, one dimension has exact size), we get a low quality image. If I use the same attributes, but load an icon using app:srcCompat, there are no any problems with quality. Also, if I use exact dimensions, it also doesn't have any problems.

To Reproduce

  1. Connect SVG module.
  2. Create Image View
      <ImageView
          android:id="@+id/icon"
           android:layout_width="30dp"
           android:layout_height="wrap_content"
           android:scaleType="fitCenter"
           android:adjustViewBounds="true"
  1. Load the SVG to the image. icon

image

Icon with android:layout_width="30dp" android:layout_height="wrap_content"

image

Icon with android:layout_width="30dp" android:layout_height="30dp"

image

Icon with android:layout_width="30dp" android:layout_height="wrap_content", but it was loaded using app:srcCompat attribute.

Version
Coil: 2.0.0-rc03
Emulator Pixel 2 API 29
Huawei Y5 2018 API 27