Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
I created a small project to repro (see attached) and while the size increased just by a little bit there for the project I work on the difference is about 0.5M in total for all images (which is about 10% of all image size).
Looks like this should be a simple check for image growth in aapt/Images.cpp, preProcessImage function, which would keep the image untouched if the compressed size is larger than original size.
Repro:
1. build an attached project (zip actually includes the build I used)
2. get apk (I used TestAapt/app/build/outputs/apk/app-debug.apk) and unzip it
3. look at the size of an image in xhdpi folder:
ls -l TestAapt/app/build/outputs/apk/zip/res/drawable-xhdpi-v4/
-rw-r----- 1 14068 Jul 31 10:14 ic_launcher.png
4. compare with the PNG in res folder of an app:
ls -l TestAapt/app/src/main/res/drawable-xhdpi
-rw-r----- 1 14043 Jul 31 10:07 ic_launcher.png
Expected: size in apk same or smaller than in res/ folder
Observed: 14068 > 14043
Again, the difference is small for this particular image, but is much bigger (and adds up) for larger projects.