I'm loading a raw SVG like shown in the sample project.
Problem is: applying a transformation onto a SVG has no effect.
See https://github.com/sebastianmarschall/GlideSvgTransformation as example.
Glide Version: 4.7.1
Integration libraries:
Caverock AndroidSvg Version: 1.2.1
Device/Android Version: Nexus 6p, Samsung S7, Samsung S9
Issue details / Repro steps / Use case background:
See the example project linked above. For example applying the "centerCrop()" transformation has no effect. My guess is that its because the Transformation is a BitmapTransformation and the loaded SVG is a PictureDrawable, but i have no idea how to work around this issue.
Glide load line / GlideModule (if any) / list Adapter code (if any):
requestBuilder = Glide.with(this)
.`as`(PictureDrawable::class.java)
.apply(RequestOptions().circleCrop())
.listener(SvgSoftwareLayerSetter())
val uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + packageName + "/" + R.raw.android_toy_h)
requestBuilder.load(uri).into(imageView)
Layout XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageView
android:id="@+id/imageView"
android:layout_width="200dp"
android:layout_height="125dp"
android:transitionName="svgTransition"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
You could write a transformation that acts on the SVG directly and apply it with transform(): http://bumptech.github.io/glide/javadocs/470/com/bumptech/glide/request/RequestOptions.html#transform-java.lang.Class-com.bumptech.glide.load.Transformation-.
Alternatively you could modify the ResourceDecoder you're using to decode the PictureDrawable to instead draw the PictureDrawable to a Bitmap. Then normal Bitmap transformations will work as well.
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
can you please be more clear about how to do this " You could write a transformation that acts on the SVG directly and apply it with Transform()"
I need the same details to resolve this issue.
I don't know what is the point of this Stale bot which marks issues as Stale since this is not resolved and needs attention.