Open bijington opened 2 years ago
@bijington @dansiegel this maybe connected, or maybe not. I was recently trying out the library (which is amazing BTW!) and noticed that my svg-s are being rendered 4 times smaller than with ResizetizerNT. I am using the default scale - 1.0 (setting the scale to 4.0 throws errors). Would appreciate some help if u have some clue what may be going on here, really don't want to bring in an extra package because everything is basically baked in here
i guess it has something to do with setting the BaseSize - https://github.com/Redth/ResizetizerNT#basesize. As i see here the biggest generated png (drawable-xxxhdpi) is exactly the same size as the BaseSize which i defined in Resizetizer
@themronion are you able to share an SVG that you are using along with the JSON config file for that image?
shared.zip Nothing special. I specify the BaseSize as 55,57 in ResizetizerNT
@themronion MBT works rather differently to ResizetizerNT, it will by default scale an image down from it's source dimensions to smaller versions for each of the possible DPIs. Now as your SVG is rather small you will need to configure it to scale up before it then applies this. Something like this should work for your me.json
file:
{
"$schema": "http://mobilebuildtools.com/schemas/v2/resourceDefinition.schema.json",
"name": "me",
"android": {
"resourceType": "Drawable",
"scale": 4
}
}
You will need to do the same for iOS but use a scale of 3.
Of course these numbers are assuming that you want the resulting image to be rendered at the same size as the SVG dimensions of 55,57.
Yeap, this tip did the trick! Thanks a lot!
Description
When applying a watermark
sourceFile
to an image the scaling is not correctly applied to the varying output sizes (see below).Reproduction Steps
Steps to reproduce the behavior:
obj
foldersExpected Behavior
The watermark image should be stretched/shrunk to correctly fit the whole output icon.
Actual Behavior
As can be seen in the screenshot the smaller icon sizes result in a smaller watermark.
Environment
Reproduction App
Please include a sample app that reproduces the issue and/or a binlog. Failure to reproduce either of these may lead to the issue being closed or ignored.