Reply
Thread Tools
Posts: 123 | Thanked: 108 times | Joined on Oct 2008 @ Prague, Czech
#1
Hi,

Jolla gallery app create ambience by crop way. This is not good.

I wrote really simple linux shell script for expand standard 540x960 wallpaper jpeg file to Jolla Ambience 540x1600 jpeg by ImageMagick tool "convert". For use on Linux desktop. Jolla phone have not ImageMagick tools ..

Code:
#! /bin/bash

[ -z $1 ] && echo "Run: $0 file_name.jpg" ; exit 2

wpdir=`dirname "$1"`
wpname=`basename "$1"`

convert "${wpdir}/${wpname}" -crop 540x1+0+0 +repage "tmp_first.jpg"
convert "${wpdir}/${wpname}" -crop 540x1+0+959 +repage "tmp_last.jpg"
convert "tmp_first.jpg" -duplicate 115,0 -append -blur 0x8 "tmp_top.jpg"
convert "tmp_last.jpg" -duplicate 261,0 -append -blur 0x8 "tmp_end1.jpg"
convert "tmp_end1.jpg" -fill black -draw 'color 0,0 reset' "tmp_end2.jpg"
convert "tmp_top.jpg" "${wpdir}/${wpname}" "tmp_end1.jpg" "tmp_end2.jpg" -append "ambience_${wpname}"

rm -f tmp_*.jpg
Script simply read "name.jpg" from script parameter, create top blurred expansion from first pixel line, bottom blurred expansion from last line and rest black space, then montage all to one 540x1600 "ambience_name.jpg" file to current directory.

Good with clean first/last lines. Right input size 540x960 pixels not checked/fixed!
But on internet are thousand 540x960 pictures/wallpapers.

540x960_input_file_example and 540x1600_ambience_output

Any better solutions are welcome..

PS: sorry for my ugly english..

Last edited by Kaacz; 2014-03-03 at 19:11.
 

The Following 7 Users Say Thank You to Kaacz For This Useful Post:
mced's Avatar
Posts: 115 | Thanked: 185 times | Joined on Apr 2011 @ Spain
#2
It shouldn't be hard to compile under Sailfish, even if it's a "low featured" ImageMagick.
 

The Following User Says Thank You to mced For This Useful Post:
HtheB's Avatar
Moderator | Posts: 3,715 | Thanked: 7,419 times | Joined on Dec 2009 @ Bize Her Yer Trabzon
#3
a simple gui would make wonders for all Sailfish OS users
__________________
www.HtheB.com
Please donate if you think I'm doing a good job.
 

The Following User Says Thank You to HtheB For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#4
Originally Posted by HtheB View Post
a simple gui would make wonders for all Sailfish OS users
I will try.. Like before via terminal...

PS. how to run your script ?

PS2. from where you installed imagemagick package ?

Last edited by Schturman; 2014-02-12 at 19:21.
 

The Following 2 Users Say Thank You to Schturman For This Useful Post:
Posts: 123 | Thanked: 108 times | Joined on Oct 2008 @ Prague, Czech
#5
Originally Posted by Schturman View Post
PS. how to run your script ?
Write jpeg file as parameter, only one file.
For batch-run two ways is possible
1) "envelope" to cycle with find "*.jpg"
2) call from other script with find and using xargs - my way on MPU desktop ..

PS2. from where you installed imagemagick package ?
I use it on desktop PC.
But for SailfishOS - Done by NielDK in OpenRepos.
 

The Following User Says Thank You to Kaacz For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#6
Originally Posted by Kaacz View Post
Write jpeg file as parameter, only one file.
For batch-run two ways is possible
1) "envelope" to cycle with find "*.jpg"
2) call from other script with find and using xargs - my way on MPU desktop ..
I use it on desktop PC.
But for SailfishOS - Done by NielDK in OpenRepos.
Thanks, I will play with it
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:01.