res PNG filesize inflated upon packaging

by piecewise » Mon, 04 May 2009 09:22:01 GMT


Sponsored Links
 I've got ~200 png files in the /res/drawable folder, mostly interface
and sprite sheet stuff. They're all indexed pngs, and weigh in at a
grand total of a bit over 400kb.

When I run aapt to package them into the apk, their filesize nearly
doubles. Opening the apk up with 7zip and extracting the drawables
confirms it: 790kb.

Does anyone have any idea why this would be happening? I thought the
packaging process was meant to compress the pngs, not inflate them! :P

Cheers,
Tom
--~--~---------~--~----~------------~-------~--~----~



res PNG filesize inflated upon packaging

by piecewise » Mon, 04 May 2009 12:03:34 GMT


 Further research reveals that aapt is indeed un-indexing the PNGs.
Once packed, they're back in full RGB mode.

I can get around this by deleting res/drawable from the .apk before
signing and dumping the original in, but this is a bit of a PITA.

I've had a look at the commandline switches for aapt: -0 says "don't
compress files" but that still doesn't affect the de-indexing of my
pngs!
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


res PNG filesize inflated upon packaging

by Jeff Sharkey » Mon, 04 May 2009 13:41:29 GMT


 Is the compressed APK size comparable to the 400kB original size?  The
790kB you quoted seems to be the unpacked size.  On the device,
resources are kept in their compressed state.  Also, I believe that
aapt in 1.5 runs drawables through pngcrush, so I'm not sure why they
are growing.

j







-- 
Jeff Sharkey
jshar...@google.com

--~--~---------~--~----~------------~-------~--~----~



res PNG filesize inflated upon packaging

by piecewise » Mon, 04 May 2009 15:01:11 GMT


 In the compressed APK they're still 790kb. I... uh... I don't know why
I said "extracting", earlier. I just meant viewing them in 7-zip. It's
Monday. :P

It's mostly an academic issue now anyway, as I've modified our ant
script to use 7-zip's commandline interface to manually extract the
RGB png's and replace them with the indexed ones. A bit hacky, I know,
but it works ok!

I'm still curious as to why this is going on, though. I'm not using
1.5; I'm only using 1.1. Is it possible that aapt in 1.1 uses pngcrush
as well, and is for some reason changing the colour mode of the pngs
from indexed to full RGB?

Cheers,
Tom





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. What options to enable in kernel config for android support?

Hi
Im new to android and
Im trying to compile android for a omap processor
i did a git clone and checkout the "origin/android-omap-2.6.29" branch
I did a defconf of the board and enabled the following options

"CONFIG_ANDROID = y
CONFIG_ANDROID_BINDER_IPC = y
CONFIG_ANDROID_LOGGER = m
CONFIG_ANDROID_RAM_CONSOLE = y
CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE = y
CONFIG_ANDROID_TIMED_GPIO = m
CONFIG_ANDROID_LOW_MEMORY_KILLER = y"

but getting a kernel panic during boot

[   26.113311] Freeing init memory:
188K
[   26.119781] Warning: unable to open an initial
console.
[   26.269561] Kernel panic - not syncing: Attempted to kill init!

Are there any other options i need to enable in the kernel ????

-montamer
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

i want install ----/root/mydroid/MyAndroid/development/samples/
PlatformLibrary/client
intermediated/pacage.apk  into emulator

but i got this error ----------------------
:~/mydroid/MyAndroid/out/target/product/generic/obj/APPS/
PlatformLibraryClient_intermediates# adb install package.apk
41 KB/s (3448 bytes in 0.080s)
        pkg: /data/local/tmp/package.apk
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

so what i will for that
can any body tell me .................

by using using this i try to add some api in android source code but
my first step is not working properly.

thanks in advance ...............

--~--~---------~--~----~------------~-------~--~----~

3. Querying AlarmManager to determine if alarms are set

4. onConfigurationChanged-function

5. End call event

6. .GIF Support

7. does linear interpolator work?