FORUMS

[TOOL][UNIX]Bootanimation Resizer

342 posts
Thanks Meter: 525
 
By frantisek.nesveda, Senior Member on 23rd August 2015, 11:49 AM
Post Reply Email Thread
Hi,

recently I have worked on resizing the Android Marshmallow bootanimation for multiple screen resolutions. To make it easier for me, I created a shell script which enables me to easily resize the bootanimation files and pack them in a flashable zip. I thought it could be useful for other users here on XDA, so I'm sharing it with you here. You can find the tool in the Downloads section of this project.

Requirements:
  • Linux / OS X / other UNIX operating system
  • imagemagick
  • (Very) basic shell knowledge


Preparation:
  1. Download the bootanimation-resizer.zip from the Downloads section of this project
  2. Extract the tool to a folder of your choosing
  3. Copy the original bootanimation.zip to this folder (the actual bootanimation, not the flashable zip)
  4. OPTIONAL: Edit the updater script in recovery-zip/META-INF/com/google/android/updater-script to include additional info about your bootanimation or other changes you wish to make


Usage:
  1. Run resize.sh with the right parameters
  2. The new bootanimation flashable zip will be saved in the folder where you extracted the tool


resize.sh parameters:
The resize.sh script is used like this:
Code:
./resize.sh WIDTH HEIGHT [ROTATION]
The parameters being:
  • WIDTH: the new width of the images
  • HEIGHT: the new height of the bootanimation images
  • ROTATION (optional): by how many degrees to rotate the animation (clockwise). The supported values are 0, 90, 180 and 270.
The rotation is applied after the resizing, so the WIDTH and HEIGHT parameters specify the new dimensions of the images before the rotation.


Example usage:
Code:
./resize.sh 800 600 90
This will resize the original images to 800x600 px and then rotate them clockwise 90 degrees.
The resulting bootanimation will be saved to bootanimation-flashable-800x600-90deg.zip.


Limitations:
  • This tool can only work with bootanimations in .zip format. It doesn't work Samsung's .qmg bootanimations, and there are no plans to add support for that.
  • The tool doesn't (necessarily) maintain aspect ratio of the images, it will resize them exactly to the dimensions you specify. These parameters you specify have to be in the correct ratio you want.


How does it work:
  1. The script extracts the files from the bootanimation.zip you provided.
  2. Using the imagemagick tool convert, it resizes and optionally rotates the images according to the parameters you specified.
  3. Then it changes the width and height parameters in the bootanimation's desc.txt. It leaves the rest of the file as it was, including the FPS, animation commands and other parameters.
  4. Then the script packs the new bootanimation to a new zip file.
  5. It adds the new bootanimation.zip to the prepared recovery-zip/system/media/ folder.
  6. Finally it zips the recovery-zip folder, creating a flashable zip with of new, resized bootanimation.

XDA:DevDB Information
Bootanimation Resizer, Tool/Utility for all devices (see above for details)

Contributors
frantisek.nesveda

Version Information
Status: Stable
Current Stable Version: 1.0
Stable Release Date: 2015-08-23

Created 2015-08-23
Last Updated 2015-08-23
The Following User Says Thank You to frantisek.nesveda For This Useful Post: [ View ] Gift frantisek.nesveda Ad-Free
23rd August 2015, 11:49 AM |#2  
OP Senior Member
Thanks Meter: 525
 
More
Reserved
Reserved for potential changelog
23rd August 2015, 11:49 AM |#3  
OP Senior Member
Thanks Meter: 525
 
More
Reserved
3rd November 2015, 06:22 PM |#4  
JT1510365's Avatar
Senior Member
Flag South Lyon
Thanks Meter: 2,012
 
More
hey man how does the resize.sh run how do you run it? through your recovery?
4th November 2015, 09:27 AM |#5  
OP Senior Member
Thanks Meter: 525
 
More
Quote:
Originally Posted by JT1510365

hey man how does the resize.sh run how do you run it? through your recovery?

No, you use it on your computer from the shell if you have Linux or a Mac.
6th December 2015, 12:36 PM |#6  
MSF Jarvis's Avatar
XDA Feed Mod/RC
Flag Ghaziabad
Thanks Meter: 7,477
 
Donate to Me
More
@frantisek.nesveda, If I strip the .sh from the script and place the file and accompanying folder into /bin, then what permissions do I need to set for the folder ???? Ofc the resize binary will be marked with chmod a+x /bin/resize .

Sent from my HTC Desire 616 dual sim customised for Puchki using Tapatalk
6th December 2015, 01:06 PM |#7  
OP Senior Member
Thanks Meter: 525
 
More
Quote:
Originally Posted by MSF Jarvis

@frantisek.nesveda, If I strip the .sh from the script and place the file and accompanying folder into /bin, then what permissions do I need to set for the folder ???? Ofc the resize binary will be marked with chmod a+x /bin/resize.

This will not work as you think it will, unfortunately. The bootanimation.zip that's being resized has to be in the same folder as the script and the accompanying folder, so if you have the script in /bin (or anywhere else in $PATH) and try to resize an animation that's for example in /home/Documents/bootanimation.zip by calling the script from that directory, it won't work. (Also I think it's not a good idea to put random folders in /bin, although it probably won't create any problems.)

This is a good idea, though, I haven't implemented it the first time because I didn't need it, but I might add it to the next version. I'm a little short on time now, so it might take a while.
The Following User Says Thank You to frantisek.nesveda For This Useful Post: [ View ] Gift frantisek.nesveda Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes