VectorLinux

Cooking up the Treats => General Development => Topic started by: Daniel on May 21, 2009, 07:11:12 pm

Title: Bootsplash Theme Creator program
Post by: Daniel on May 21, 2009, 07:11:12 pm
Note: All the attachments in this thread have been standardized. You will get the same version (the final version) from any attachment. You must run the included installer first if you want the program to be available in vasmCC. The program is available as a .tlz package or as the pieces (script, installer...).

I have written a Bootsplash Theme Creator script program. It uses zenity for the GUI. It follows and automates the processes described by stretchedthin on www.opensourcebistro.com. Thank you very much stretchedthin! Here is a link to stretchedthin's instructions: http://www.opensourcebistro.com/Tutorial/VL60/16.SystemAdmin/vasmcc/utilities/vlbsplash-switch/custom-boot-splash.htm

The Bootsplash Theme Creator program is attached if you would like to try it. After you run the program and create a bootsplash theme, you need to use VLBootsplash-Switch in VASM to switch to your new bootsplash. If you run Bootsplash Theme Creator from a console, you may see these error messages: "Bootsplash-Theme-Creator.sh: line 42: config: command not found" or "ls: cannot access /etc/bootsplash/themes/example/: No such file or directory
doesn't exist" These are merely the results of some intentional file checking in the script and are not problems. Please let me know how you like it and if there are any problems with it. I have not been able to actually use my custom bootsplashes from this program because I am running VL 5.9.1 SOHO (with KDE) and KDE's bootsplash switcher appears to take precedence over the VASM bootsplash switcher. If anyone has any suggestions on how to change that, they would be most welcome.

Enjoy!

Note: This program must be run as root. It will check and notify you if you are trying to run it as a normal user.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 22, 2009, 12:02:37 am
Hi Daniel:
Looks cool.  I'll give it a go as soon as I can.  Would it be ok with you if I offered the download off of my site as well.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 22, 2009, 07:56:57 am
Thanks stretchedthin, yes that would be fine with me if you want to put the download on your site too.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 22, 2009, 07:26:24 pm
Hey Daniel;  I've tried the application on two different machines using two different jpg's.  The new theme seems to create just fine and shows up in VLbootsplash-switch, but when I reboot I only get verbose mode, no picture.
 
I'll look into it some more.  Hopefully, it's just my error, but I'll let you know what I find out.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 22, 2009, 07:53:36 pm
Is there a bootsplash switcher in XFCE4 that might have turned off the splash screen and is overriding the VASM switcher like what happened to me with KDE? It seemed to be working for you when you made the tutorial but I don't know, it was just a thought.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 22, 2009, 10:52:01 pm
Well I don't think anything is wrong with your application.  I just downloaded VLm-akes theme package and used your program to install.  It worked just fine.

It seems there is more to preparing a .jpg to be a bootsplash than just resizing it.  I'll try to figure out what that is.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 23, 2009, 11:54:06 am
Hmm... I think you're right. I have two different bootsplash themes to choose from by default and the images for those show the bootsplash picture looking different than the silent bootsplash picture. The bootsplash picture looks like the picture it shows when it's showing the bootsplash but you press Esc to show verbose. But if you have to do something to make the pictures different, why did it work for you when you made the tutorial? I wonder if saving the picture as "silent..." in GIMP is different from doing what I did in the script: copying and renaming the "bootsplash..." picture. But then, if you installed VLm-akes theme package, the script should have copied and renamed the "bootsplash..." picture just like it always does. And it worked for for some reason. By the way, I think my KDE bootsplash switcher isn't interfering after all. I'm still not sure what the problem is though.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 23, 2009, 12:55:03 pm
In my tutorial I used the same picture for bootsplash-~.jpg as I did for silent-~.jpg.  If you look at std or VLm-akes pictures the bootsplash and silent differ.  The bootsplash .jpg's are used when verbose mode is in use and silent-~.jpgs when it is not.
You script is fine, it just uses the same picture for both, no problem there.

In my tutorial I used a picture from my camera, when I tried it this time I used a picture I downloaded from the internet that was 1280x1024 from the start.  That's the one I couldn't get to work.

I then tried some pictures that where emailed to me.  One worked and one didn't...go figure.

I am going to experiment a little more.  Maybe it's the x and y resolution, maybe it's the overall picture size in mb, maybe it's the EXIF data or subsampling, hell maybe '.jpg' has to be '.JPG'.

I'll keep playing with it.  I like the overall concept of your app though.  For users to take a favorite picture and make it there bootsplash that easily is cool.
Title: Re: Bootsplash Theme Creator program
Post by: toothandnail on May 23, 2009, 03:30:41 pm
 ;D I'll be waiting to see the final outcome. I've been meaning to make my own bootsplash for a while - running my laptop in 1280 x 800 frame bufer mode breaks the standard bootsplash.

Looking forward to the final version....

paul.
Title: Re: Bootsplash Theme Creator program
Post by: uelsk8s on May 23, 2009, 07:15:13 pm
there are some guidelines for bootsplash jpegs, and bootsplash has some resolutions it is limited to.
resolutions supported by bootsplash are "640x480  800x600  1024x768 1280x1024" at 64k
Quote
make sure the jpeg you are using has a pixels per inch resolution of 96x96

Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 25, 2009, 12:28:44 am
I found this on linuxquestions.org

Quote
Almost all jpegs are YCbCr, the exception are some jpegs created on an Apple Mac and Windows.

If you use the gimp, don't check the "Progressive" box. Also, subsampling must be 2x2, 1x1, 1x1 (that's what the 221111 hints at).

Than your jpeg should work.

I remade the 3 required bootsplashes using the above rules and 2 of my pictures which previously failed worded flawlessly.  The
third picture would have worked as well but .jpg was capitalized as .JPG (a carryover from the name it had before).  Once that was
corrected it worked as well.

So some simple rules for resizing with Gimp...
1. Don't check the "Progressive" box ( or anyother box on the left, why would you need EXIF data or thumbnails anyway)
2. Subsampling must be 2x2,1x1,1x1.
3. .jpg can't be capitalized, (I think that rule is just for me.)
4. Use the slider to reduce the file size as much as the picture quality can bear.  Smaller file sizes make for faster boots, but a large file size does not seem to prevent the picture from showing.  I have 1024x768 ranging from 40kb to 178kb all work.

With those rules your "Bootsplash-Theme-Creator" worked like a charm.  I'll work on a screencast in the next couple of days. Thanks for this.
stretched
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 25, 2009, 03:01:16 pm
Thanks stretchedthin! I will make some changes to the script and either include that information or a link to your screencast or both. If that's ok with you.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 25, 2009, 03:25:03 pm
Works for me.

This may be a tall order but how much work would it be to use a command line suite like imagemagick to size the pictures for the user?  Just had the idea when I saw the new version of imagemagick released on distrowatch.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 25, 2009, 06:21:03 pm
Well, that sounds interesting, but... Gslapt and slapt-get both say I have ImageMagick installed but Gslapt says that I have it installed to a non-existent directory. ( /mnt/source/packages/... ) And "imagemagick" doesn't work from the terminal. I tried reinstalling it but it still didn't work. Any suggestions?
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 25, 2009, 07:43:03 pm
ImageMagick is a sweet of programs with a huge number of command line utitities. The one you want is 'convert' or maybe 'mogrify'.

Here is the page on it's usage.
http://www.imagemagick.org/script/mogrify.php (http://www.imagemagick.org/script/mogrify.php)

Here is another with more specifics
http://www.imagemagick.org/Usage/resize/#noaspect (http://www.imagemagick.org/Usage/resize/#noaspect)

I'll read up a little more.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 25, 2009, 08:17:21 pm
I think "convert" is the one I need. It seems to be working. I don't think it will be too much trouble to integrate it into the script. Thanks again!
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 25, 2009, 08:20:51 pm
OK, just made this bash script.
Place it in a directory with only one picture and it will resize and name each of the required bootsplash's, when executed.

#!/bin/bash
cp ./*JPG original.jpg
cp ./*jpg original.jpg
convert original.jpg -resample 72 -resize 1280x1024\! bootsplash-1280x1024.jpg
convert original.jpg -resample 72 -resize 1024x768\! bootsplash-1024x768.jpg
convert original.jpg -resample 72 -resize 800x600\! bootsplash-800x600.jpg
exit

I just saw your post.  I'll let you take it from here.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 26, 2009, 06:26:07 am
What does "-resample" do?
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 26, 2009, 08:24:42 am
-resample changes the pixel per inch.  The bootsplashes that worked for me were at 72 pixels per inch.  This could be played with Uelsk8s suggested in this thread that 96 pixels per inch worked as well.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 26, 2009, 12:48:24 pm
Well, I tried "-resample 72", "-resample 96", and no resample at all but it still didn't work when I rebooted. Does the framebuffer console/normal console stuff in lilo.conf have to be set a certain way?
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 26, 2009, 01:33:25 pm
I think the picture may still be to big. (In kilobytes not resolution)  What is the size in kb's of the picture that will not display?
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 26, 2009, 03:18:59 pm
The picture is 35.2 kb in size. I think I did have the bootsplash thing in lilo set wrong so I fixed that and rebooted. The bootsplash came up, the progress bar started going across, the screen flickered, and it froze. It wouldn't continue booting. I had to boot my computer with the VL installation cd. Is the problem the size of the picture? (kb)
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 26, 2009, 04:59:55 pm
Hi Daniel;

Here is a short screencast that shows the method that has been successful for me so far.
http://www.opensourcebistro.com/Tutorial/VL60/16.SystemAdmin/vasmcc/utilities/vlbsplash-switch/bootsplash.htm (http://www.opensourcebistro.com/Tutorial/VL60/16.SystemAdmin/vasmcc/utilities/vlbsplash-switch/bootsplash.htm)

This really minimizes the need to use the gimp.  Sometimes you don't have to use Gimp at all, but sometimes you do.  That's where I'm just guessing as to what the problem is still.
Title: Re: Bootsplash Theme Creator program
Post by: Masta on May 26, 2009, 08:37:51 pm
The picture is 35.2 kb in size. I think I did have the bootsplash thing in lilo set wrong so I fixed that and rebooted. The bootsplash came up, the progress bar started going across, the screen flickered, and it froze. It wouldn't continue booting. I had to boot my computer with the VL installation cd. Is the problem the size of the picture? (kb)

No it's not the size.  Try resetting back to a known to work theme, reboot, then switch to your theme again, reboot.

Sometimes, it seems, that it doesn't take the switch very well, and the init gets a little corrupt. Usually the above will do the trick.

Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 29, 2009, 09:19:50 am
The picture is 35.2 kb in size. I think I did have the bootsplash thing in lilo set wrong so I fixed that and rebooted. The bootsplash came up, the progress bar started going across, the screen flickered, and it froze. It wouldn't continue booting. I had to boot my computer with the VL installation cd. Is the problem the size of the picture? (kb)

No it's not the size.  Try resetting back to a known to work theme, reboot, then switch to your theme again, reboot.

Sometimes, it seems, that it doesn't take the switch very well, and the init gets a little corrupt. Usually the above will do the trick.



Well, I tried switching to a theme that was already there (that I didn't make) and rebooting. It started coming up but just like with my themes, it stopped and froze at "Performing Coldplugging". I think my hardware might not work with the bootsplash or something.

Anyway, Bootsplash Theme Creator version 1.5 is ready to be tested. It incorporates image resizing now so that it only needs a single picture instead of 3 different resolutions of one. It also has progress dialogs and at the end, it asks if you want to run the VL Bootsplash Switcher to switch to your newly made theme. Please test!
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 29, 2009, 09:48:00 am
Hi Daniel;

I will test and get back to you shortly.

In the mean time, try and run vliloconf as root in the terminal.
This will reset the lilo bootsplash settings and may help you out.  I'm not sure how it's worded but you want to choose
either high res or extra high res.

See if that helps any.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 29, 2009, 11:31:02 am
Before I get started on the testing,  I just wanted to say great job.  Really appreciate the work you are putting into this.
This is going to be a great little app when you are done.

Started with an image choosen from google images.
cloudsA_1289x1024.jpg
Image size 119.2 KB, 72pi/inch, had a Subsampling of 1x1,1x1,1x1 (best quality)
Using the image exactly as is (no editing with gimp)
It just did not work.

Same image edited with gimp to change Subsampling to 2x2, 1x1, 1x1 (smallest file)
plus unchecked "Optimize"

This time it worked flawlessley.   So right now the program is fine just as it is for pictures
which are already subsampled to 2x2,1x1,1x1.

It does require an extra step for pictures which are set to the best quality subsample.

I found another -option that shoud add this function to your project and added into these lines...

convert $pic -resample 72 -sampling-factor 2x2 -resize 1024x768\! /etc/bootsplash/themes/$name/images/bootsplash-1024x768.jpg

convert $pic -resample 72 -sampling-factor 2x2 -resize 1280x1024\! /etc/bootsplash/themes/$name/images/bootsplash-1280x1024.jpg

convert $pic -resample 72 -sampling-factor 2x2 -resize 800x600\! /etc/bootsplash/themes/$name/images/bootsplash-800x600.jpg

#Copying and resizing the silent .jpg files.

zenity --progress --pulsate --title="working..." --text="Copying and resizing silent .jpg..." --percentage=60 --timeout 1

convert $pic -resample 72 -sampling-factor 2x2 -resize 1024x768\! /etc/bootsplash/themes/$name/images/silent-1024x768.jpg

convert $pic -resample 72 -sampling-factor 2x2 -resize 1280x1024\! /etc/bootsplash/themes/$name/images/silent-1280x1024.jpg

convert $pic -resample 72 -sampling-factor 2x2 -resize 800x600\! /etc/bootsplash/themes/$name/images/silent-800x600.jpg


I was then able to use the picture that previously failed, directly in your application (with out any editing by gimp).
This time it worked flawlessly.   However, it will still need to be tested.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 29, 2009, 03:26:27 pm
Ok, here is v1.5 with the "-sampling-factor 2x2" fix. Also, this is the 3rd posting of a version of my program, I thought I should make all the attachments the same so would I be able to modify the post and do that?
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 29, 2009, 03:37:17 pm
Ok, here is v1.5 with the "-sampling-factor 2x2" fix. Also, this is the 3rd posting of a version of my program, I thought I should make all the attachments the same so would I be able to modify the post and do that?

Yes you should be able to use the 'Modify' option to change each of your postings.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 29, 2009, 07:34:57 pm
Ok, done. All the attachments are the same now.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 30, 2009, 09:44:35 am
Hi Daniel:
I just had a thought about large picture sizes.  Cameras now have huge resolution and it is predictable that your end user of this application is going to try and start with a picture that has a equally huge file size.  While a very wide range of file sizes are accepted by bootsplash, I have made several pictures fail in my testing by using pictures >750kb.  I don't know the exact threshold.

While you could use Imagemagick's -quality option to reduce the filesize, you would also have to  come up with a test to make
sure you are only reducing those that need it and determining what maybe too much of a reduction.

I think the simple solution would be at the front end to post some instruction that the user should make sure they are starting with a picture that is <500kb say.

You could also use a bit of script like this to show the user the size of the picture they have choosen.  Even warn them that a large size will slow boot time or may not work at all.

identify -verbose imagename.jpeg | grep Filesize

Anyway, Great little application.

Here's an example of a picture that did not work for me until I reduced it's file size with the -quality option.
http://spiritual-art.info/wallpapers/animals/1280/1280x1024_kittens4.jpg (http://spiritual-art.info/wallpapers/animals/1280/1280x1024_kittens4.jpg)
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 30, 2009, 02:45:08 pm
Ok, version 1.6, the fourth and (I hope) final version. The script now checks to make sure that you have actually selected a .jpg file and not something else. There is also a warning against using very large .jpg files. The warning is displayed, the selected file's size is displayed, but the choice is left up to the user. (after recommending that the picture be smaller than 500kb) Thank you very much stretchedthin for helping me with testing and suggesting improvements. Just to clarify, the last version did work right? There are no changes to what happens to the image file (resizing and such) so this version should work the same in that regard. Again, all the attachments of the script in this thread will be standardized so you will get the same program from any attachment.
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 30, 2009, 03:07:41 pm
No problem, Daniel.  This was fun and a good excuse to learn about imagemagick.  Oh, and yes the last script worked just fine.  I was just testing it against some large file sizes. 

Again; nice job.  This is a cool little app. 

What licensing are you releasing this under. I couldn't find anything in the script.  You may want to include something just so people know they can distribute it freely.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 30, 2009, 03:17:39 pm
1. Good, thanks again for testing.
2. Hmm... Licensing, good question. Would that be just a statement saying that it is freely distributable software? or is there a more formal statement that one should use? (something about GPL General Public License?)
Title: Re: Bootsplash Theme Creator program
Post by: stretchedthin on May 30, 2009, 11:08:34 pm
I'm no expert, maybe someone else in the forum could speak more definitively on this.  I would guess that you could simply state your intentions in a commented area near the top.  Since you script relies heavily on GPL'd applications to do what it is designed to do, I'm not sure you could release it any other way than as GPL.

Really would like to hear from someone who is better versed in these matters.
Title: Re: Bootsplash Theme Creator program
Post by: Masta on May 31, 2009, 09:16:25 am
It is an application so I would go with GPL. This allows others to work / hack on it and still keeps it freely distributable. Licensing is a hard thing when you're trying to decide which one best suits you. Best I can offer other than suggesting GPL, is to read up on licenses. I know that is time consuming and sometimes they can be confusing.

Now, I have not had a moment to test this nifty sounding app out as of yet, so before I do, I'd like to ask what it does.... besides bootsplash. I mean:
 does it make all resolutions for the splash?
 does it create a lilo image too?
 is the progress bar location "preset" or does user have an option where to place it, and size etc.?
 is the verbose text window adjustable or is it "preset"?

This application sounds like it would certainly be a very useful "tool" as well as something to use for fun. Without yet testing, this sounds like it would be a nice addition to the Vector Control Center. Thanks for taking your time to build this!

Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 31, 2009, 10:53:36 am
It is an application so I would go with GPL.

So is there a special format for using GPL or do you just say something like "This application has a GPL licence."? As far was what the program does, it makes the 1024x768, 1280x1024, and 800x600 bootsplash images. (the most common) After it creates the theme, the program asks if the user wants to run the VL Bootsplash Switcher to switch to the new theme. (so that lilo will use that theme) The program has no control over the progress bar. The program uses the same picture for both the normal bootsplash and the verbose screen so the verbose screen isn't adjustable from the program. Yes, it would be a nice companion module to the VL Bootsplash Switcher in VASMCC. I think it's Moe-lnx who does VASMCC so Moe if you want to say something about that, go ahead.

Did that answer your questions Masta?
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on May 31, 2009, 06:23:41 pm
Ok, I found another script that mentioned the GPL license so I ended up putting "#Released under the GPL license." in my script. All attachments will be standardized again.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on June 01, 2009, 08:23:41 pm
I had a thought, since the final version of the script seems to be ready, should I add (FINAL) to the subject line for this thread?
Title: Re: Bootsplash Theme Creator program
Post by: Masta on June 02, 2009, 09:10:10 pm
It is an application so I would go with GPL.

So is there a special format for using GPL or do you just say something like "This application has a GPL licence."? As far was what the program does, it makes the 1024x768, 1280x1024, and 800x600 bootsplash images. (the most common) After it creates the theme, the program asks if the user wants to run the VL Bootsplash Switcher to switch to the new theme. (so that lilo will use that theme) The program has no control over the progress bar. The program uses the same picture for both the normal bootsplash and the verbose screen so the verbose screen isn't adjustable from the program. Yes, it would be a nice companion module to the VL Bootsplash Switcher in VASMCC. I think it's Moe-lnx who does VASMCC so Moe if you want to say something about that, go ahead.

Did that answer your questions Masta?
Yep answers my question quite well.
Glad you found the GPL script.
Looks like I'll be hand making the configuration files still... but maybe in the future you could somehow work that into the app or something... just a thought :)
Wonderful work, just wonderful............

Title: Re: Bootsplash Theme Creator program
Post by: Daniel on June 03, 2009, 05:48:01 pm
That is in the app already. When it creates a new theme, it copies existing configuration files and edits them to use the correct file path. (I assume you mean the config files in /etc/bootsplash/themes/<theme>/config) So the config files don't have to be edited or made by hand unless you want to do more custom configuration.
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on June 04, 2009, 09:14:03 am
Ok, Moe-lnx told me how to install a program into vasmCC. Thanks Moe! So now when you download the attached .zip file, you get the program itself, a .desktop file for it, and an install and uninstall script for installing it in vasmCC and for uninstalling it if you want. You must the installer and uninstaller as root. It will remind you if you forget though. All the attachments will be standardized a few minutes after this post.
Title: Re: Bootsplash Theme Creator program
Post by: Masta on June 08, 2009, 06:55:05 am
Hey this IS great! I will still need to customize a little bit by hand, but this does take some time off from that. If I stick to a standard theme, that wouldn't be necessary, but if I make something unique....
Still this saves me a few lines in the config's :)
Again, Well Done! and Thanks!
Title: Re: Bootsplash Theme Creator program
Post by: Daniel on June 08, 2009, 06:38:06 pm
Ok, I am now offering the program as a .tlz package as well. Thanks again to Moe for helping with that. I will attach it here and on the first page of this thread. No problems anticipated with the package but please test. (The package is in the .zip file because I can't upload .tlz files.)