diff --git a/.gitignore b/.gitignore index d913a000..68800b5a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ utils/send.sh *.out *.d *.pdf +*.tar.gz default.sb default.tex french.sb diff --git a/NEWS b/NEWS index 7efe1cfb..4bc82719 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,23 @@ +version 3.5.7 + +Hanarka: + Alain Souchon - La ballade de Jim + Francis Cabrel - Octobre + Maxime Le Forestier - Passer ma route + Alain Souchon - Sous les jupes des filles + Phil Barney - Un enfant de toi + Roch Voisine - Hélène + Téléphone - Le jour s'est levé +Romain Goffe: + Gerry Rafferty - To each and everyone + Le Donjon de Naheulbeuk - Maître du donjon +broph: + Jean-Jacques Goldman - On ira + version 3.5.6 -Dimitri Delporte: +Hanarka: Belyscendre - Hélas madame Francis Cabrel - La corrida Romain Goffe: diff --git a/books/naheulbeuk.sb b/books/naheulbeuk.sb index 8b9930f7..aca84e50 100644 --- a/books/naheulbeuk.sb +++ b/books/naheulbeuk.sb @@ -13,7 +13,7 @@ "picturecopyright" : "Personnages par \\emph{Pen Of Chaos} / Illustrations par \\emph{Marion Poinsot}", "subtitle" : "Recueil de chansons non-officiel", "title" : "Le Donjon de Naheulbeuk", -"version" : "0.4.1", +"version" : "0.5", "songs" : [ "Belyscendre/Helas_madame.sg", "Belyscendre/Mon_pere_veut_me_marier.sg", @@ -31,6 +31,7 @@ "Le_Donjon_de_Naheulbeuk/Les_elfes_de_GreenElven.sg", "Le_Donjon_de_Naheulbeuk/Les_souliers_de_Lady_Fae.sg", "Le_Donjon_de_Naheulbeuk/Les_epees_Durandil.sg", + "Le_Donjon_de_Naheulbeuk/Maitre_du_donjon.sg", "Le_Donjon_de_Naheulbeuk/Marche_barbare.sg", "Le_Donjon_de_Naheulbeuk/Massacrons_nous_dans_la_taverne.sg", "Le_Donjon_de_Naheulbeuk/Mon_ancetre_Gurdil.sg", diff --git a/books/volume-5.sb b/books/volume-5.sb index 829eddbb..97c6b918 100644 --- a/books/volume-5.sb +++ b/books/volume-5.sb @@ -11,6 +11,8 @@ "picturecopyright" : "hit-squad @ deviantart.com", "subtitle" : "Tome 5", "songs" : [ + "Alain_Souchon/La_ballade_de_Jim.sg", + "Alain_Souchon/Sous_les_jupes_des_filles.sg", "Anis/Dans_tes_yeux.sg", "Belyscendre/Helas_madame.sg", "Calvin_Russell/Down_down_down.sg", @@ -21,15 +23,23 @@ "Debout_Sur_Le_Zinc/Scylla.sg", "Debout_Sur_Le_Zinc/Sur_le_fil.sg", "Francis_Cabrel/La_corrida.sg", + "Francis_Cabrel/Octobre.sg", "Gary_Jules/Mad_world.sg", + "Gerry_Rafferty/To_each_and_everyone.sg", "Jacques_Dutronc/La_fille_du_Pere_Noel.sg", "Jali/Espanola.sg", + "Jean-Jacques_Goldman/On_ira.sg", "La_Rue_Ketanou/Sao_loucas.sg", "Le_clandestin/Rue_Grenelle.sg", + "Le_Donjon_de_Naheulbeuk/Maitre_du_donjon.sg", "Les_Booze_Brothers/Fields_of_Athenry.sg", "Les_Cowboys_Fringants/8_secondes.sg", "Les_Cowboys_Fringants/Ces_temps_ci.sg", "Les_Fatals_Picards/Au_mariage_de_Kevin_et_de_ma_soeur.sg", + "Maxime_Le_Forestier/Passer_ma_route.sg", + "Phil_Barney/Un_enfant_de_toi.sg", + "Roch_Voisine/Helene.sg", + "Telephone/Le_jour_s_est_leve.sg", "The_Bloody_Irish_Boys/Drunk_tonight.sg", "The_Dubliners/The_wild_rover.sg", "Thomas_Fersen/Bambi.sg", diff --git a/makefile b/makefile index dfc8af3f..1eb75992 100644 --- a/makefile +++ b/makefile @@ -92,15 +92,16 @@ $(CHORDS): $(CHORDS_SRC) $(MAKE_CHORDS) -o $@ archive: clean - tar -czvf songbook-$(DATE).tar.gz \ + tar -czvf songbook.tar.gz \ --exclude=*pdf \ - --exclude=.git --exclude=.gitignore \ + --exclude-vcs \ --exclude=$(BOOKS_DIR)/default.sb \ --exclude=perso/* --exclude=perso \ --exclude=build/* --exclude=build \ --exclude=covers/* --exclude=covers \ --exclude=data/* --exclude=data \ --exclude=*tar.gz \ + --transform 's/songbook/songbook-$(DATE)/1' \ ../songbook ifeq (.pdf,$(suffix $(MAKECMDGOALS))) diff --git a/songs/Gerry_Rafferty/To_each_and_everyone.sg b/songs/Gerry_Rafferty/To_each_and_everyone.sg new file mode 100644 index 00000000..bb281d1d --- /dev/null +++ b/songs/Gerry_Rafferty/To_each_and_everyone.sg @@ -0,0 +1,49 @@ +\selectlanguage{english} +\songcolumns{2} +\beginsong{To each and everyone} + [by=Gerry Rafferty,cov=can-i-have-my-money-back,album=Can I have my money back?] + + \cover + \gtab{Bm}{2:X02210} + \gtab{A}{X02220} + \gtab{D}{XX0232} + \gtab{C}{X32010} + \gtab{Em}{022000} + \gtab{F#7}{2:020100} + \gtab{D7}{XX0212} + \gtab{G}{320003} + \gtab*{Gsus4}{X32033} + + \begin{verse} + To \[Bm]each and \[A]every \[D]one of \[C]you + \[Em]I say good\[Bm]bye, fare\[D]well, of \[A]you + \[Bm] To each and \[A]all I \[D]say good\[C]bye + I \[Em]know it's been \[Bm]fun but we're \[F#7]living a \[Bm]lie + \end{verse} + + \begin{repeatedchords} + \begin{verse} + You \[Bm]said you \[A]spoke straight \[D]from your \[C]heart + But \[Em]that was the \[Bm]one thing that \[D]kept us a\[A]part + \[Bm] 'Cause when I \[A]read bet\[D]ween the \[C]lines + I \[Em]saw that the \[Bm]only heart \[F#7]speaking was \[Bm]mine + \end{verse} + \end{repeatedchords} + + \begin{chorus} + \[Bm] To each and every\[D7]one of you + I \[G]say goodbye, in\[Gsus4]deed I do + \[Bm] If you should ask me \[D7]why I go + I \[G]wouldn't say 'cause \[Gsus4]you should know + \end{chorus} + + \begin{repeatedchords} + \begin{verse} + \[Bm] When every\[A]thing is \[D]said and \[C]done + \[Em]Nothing's been \[Bm]lost and \[D]nothing's been \[A]won + \[Bm] I took from \[A]you, \[D] you took from \[C]me + \[Em]But I sup\[Bm]pose that's how \[F#7]it had to \[Bm]be + \end{verse} + \end{repeatedchords} + +\endsong diff --git a/songs/Gerry_Rafferty/can-i-have-my-money-back.jpg b/songs/Gerry_Rafferty/can-i-have-my-money-back.jpg new file mode 100644 index 00000000..d18e5124 Binary files /dev/null and b/songs/Gerry_Rafferty/can-i-have-my-money-back.jpg differ diff --git a/songs/Jonathan_Coulton/portal.jpg b/songs/Jonathan_Coulton/portal.jpg index 2a018c80..971c1d96 100644 Binary files a/songs/Jonathan_Coulton/portal.jpg and b/songs/Jonathan_Coulton/portal.jpg differ diff --git a/songs/Le_Donjon_de_Naheulbeuk/La_vie_d_aventurier.sg b/songs/Le_Donjon_de_Naheulbeuk/La_vie_d_aventurier.sg index 83c77201..0271fe6c 100644 --- a/songs/Le_Donjon_de_Naheulbeuk/La_vie_d_aventurier.sg +++ b/songs/Le_Donjon_de_Naheulbeuk/La_vie_d_aventurier.sg @@ -1,7 +1,7 @@ \selectlanguage{french} \songcolumns{2} \beginsong{La vie d'aventurier} - [by=Le Donjon de Naheulbeuk] + [by=Le Donjon de Naheulbeuk,cov=t-as-pas-le-niveau,album=T'as pas le niveau] \cover \gtab{G}{320003} diff --git a/songs/Le_Donjon_de_Naheulbeuk/Le_laride_du_poulet.sg b/songs/Le_Donjon_de_Naheulbeuk/Le_laride_du_poulet.sg index 963effb2..31659eb8 100644 --- a/songs/Le_Donjon_de_Naheulbeuk/Le_laride_du_poulet.sg +++ b/songs/Le_Donjon_de_Naheulbeuk/Le_laride_du_poulet.sg @@ -1,8 +1,9 @@ \selectlanguage{french} \songcolumns{2} \beginsong{Le laridé du poulet} - [by=Le Donjon de Naheulbeuk] + [by=Le Donjon de Naheulbeuk,cov=t-as-pas-le-niveau,album=T'as pas le niveau] + \cover \gtab{Am}{X02210} \gtab{G}{320003} \gtab{F}{1:022100} diff --git a/songs/Le_Donjon_de_Naheulbeuk/Maitre_du_donjon.sg b/songs/Le_Donjon_de_Naheulbeuk/Maitre_du_donjon.sg new file mode 100644 index 00000000..17973cf9 --- /dev/null +++ b/songs/Le_Donjon_de_Naheulbeuk/Maitre_du_donjon.sg @@ -0,0 +1,159 @@ +\selectlanguage{french} +\songcolumns{2} +\beginsong{Maître du donjon} + [by=Le Donjon de Naheulbeuk,cov=t-as-pas-le-niveau,album=T'as pas le niveau] + + \cover + \gtab{Dm}{5:X02210} + \gtab{C}{3:X02220} + \gtab{F}{1:022100} + \gtab{B&}{1:X02220} + \gtab{Am}{X02210} + \gtab{G}{X02210} + \gtab*{Gm7}{3:030000} + \gtab{Em}{022000} + + \begin{verse} + \[Dm] Après de nombreuse aventures + Qui s'étaient \[C]très mal termi\[Dm]nées \[C Dm] + \[Dm] J'étais lassé de mon armure + J'étais las\[C]sé de voya\[Dm]ger \[C F] + \end{verse} + + \begin{verse*} + \[F] On m'avait parlé d'un donjon + Caché dans une sombre fo\[C]rêt + \[B&] Avec oubliette et pri\[C]son + Salle de torture et jardi\[Dm]net + \end{verse*} + + \begin{chorus} + \[Dm]Adieu l'aven\[C]ture + \[Dm]Je laissais là mes \[C]compagnons + \[F]Terminée la vie \[C]dure + \[B&] Je serai maître \[C] du don\[Dm]jon + \end{chorus} + + \begin{repeatedchords} + \begin{verse} + \[Dm] C'était vraiment une bonne affaire + Un donjon \[C]garni clé en \[Dm]main \[C Dm] + \[Dm] Les pièges neufs de l'année dernière + Des monstres \[C]dans les souter\[Dm]rains \[C F] + \end{verse} + + \begin{verse*} + \[F] Dans le salon un coffre-fort + Sans plus attendre, t'as si\[C]gné + \[B&] Dans ton esprit, un seul re\[C]mord + Tu n'avais pas tout visi\[Dm]té + \end{verse*} + + \begin{chorus} + \[Dm]Adieu l'aven\[C]ture + \[Dm]Plus jamais de \[C]quêtes à la con + \[F]À l'abri dans mes \[C]murs + \[B&] C'est moi le maître \[C] du don\[Dm]jon + \end{chorus} + + \begin{verse} + \[Dm] Enfin ce fut l'installation + Je n'étais \[C]plus aventu\[Dm]rier \[C Dm] + \[Dm] J'ai vite planqué tout mon pognon + Dans le coffre \[C]en acier trem\[Dm]pé \[C F] + \end{verse} + + \begin{verse*} + \[F] J'actionnai les pièges à l'entrée + Et m'allongeai sur des cous\[C]sins + \[B&] J'allais enfin dormir en \[C]paix + C'était sans compter les \[Dm]gobelins + \end{verse*} + + \begin{chorus} + \[Dm]Adieu l'aven\[C]ture + \[Dm]Mon coffret n'a \[C]pas tenu bon + \[F]Maudites créa\[C]tures + \[B&] C'est moi le maître \[C] du don\[Dm]jon + \end{chorus} + \end{repeatedchords} + + \begin{verse} + \[Am] Tes pièces d'or avaient disparu + Tu courus \[G]prendre mon é\[Am]pée + \[Am] \echo{Mes pièces d'or avaient disparu + Je courus \[G]prendre mon é\[Am]pée} + \[Am] Puis tu sortis à moitié nu + Hurlant de \[G]rage et meurtri\[Am]er + \[Am] \echo{Puis je sortis à moitié nu + Hurlant de \[G]rage et meurtri\[Am]er} + \end{verse} + + \begin{verse*} + \[C] Les cuisines étaient dévastées + Fallait voir l'état des pri\[Gm7]sons + \echo{Le personnel de nettoyage + Va réclamer l'augmentation} + \[Gm7] Ces peaux vertes allaient dégus\[C]ter + C'était sans compter les \[Dm]scorpions + \end{verse*} + + \begin{verse} + \[Am] Dans l'ombre de mes souterrains + J'avais glis\[Em]sé dans les scor\[Am]pions \[Em Am] + \[Am] Je sautillais comme crétin + Pour qu'ils dé\[Em]gagent de mon cale\[Am]çon \[Em C] + \end{verse} + + \begin{verse*} + \[C] Reprenant ma course effrénée + J'étais juste sur leurs ta\[Gm7]lons + \[Gm7] J'allais enfin les rattra\[C]per + C'était sans compter le \[Dm]démon + \end{verse*} + + \begin{repeatedchords} + \begin{chorus} + \[Dm]Adieu l'aven\[C]ture + \[Dm]Je suis tombé sur \[C]un démon + \[F]{J'ai} pas la car\[C]rure + \[B&] C'est lui le maître \[C] du don\[Dm]jon + \end{chorus} + + \begin{verse} + \[Dm] Descendant plus bas dans les caves + J'entendis \[C]des gens psalmo\[Dm]dier \[C Dm] + \[Dm] Un démon la gueule pleine de bave + Hurla que \[C]je sois sacri\[Dm]fié \[C F] + \end{verse} + + \begin{verse*} + \[F] Tant pis pour l'or et les gobelins + Sans plus attendre, j'ai fi\[C]lé + \[B&] Je repartais sur les che\[C]mins + J'oubliais les pièges à l'\[Dm]entrée + \end{verse*} + + \begin{chorus} + \[Dm]Adieu l'aven\[C]ture + \[Dm]{J'ai} déclenché une \[C]explosion + \[F]Qui ébranla les \[C]murs + \[B&] Et fit s'écrouler \[C] le don\[Dm]jon + \end{chorus} + \end{repeatedchords} + + \begin{chorus} + \[Dm]Laisse tomber l'aven\[C]ture + \[Dm]{T'as} pas l'niveau pour \[C]un donjon + \[F]Pose ici ton ar\[C]mure + \[B&] Et viens chanter une p'tite chanson + \end{chorus} + + \begin{chorus} + \[Dm]Laisse tomber l'aven\[C]ture + \[Dm]Amène plutôt du sauci\[C]sson + \[F]Car c'est beaucoup moins \[C]dur + \[B&] D'être le maître \[C] du jam\[Dm]bon + \end{chorus} + +\endsong diff --git a/songs/Le_Donjon_de_Naheulbeuk/Nanana_de_l_elfe.sg b/songs/Le_Donjon_de_Naheulbeuk/Nanana_de_l_elfe.sg index 31281ed6..a93c0cc3 100644 --- a/songs/Le_Donjon_de_Naheulbeuk/Nanana_de_l_elfe.sg +++ b/songs/Le_Donjon_de_Naheulbeuk/Nanana_de_l_elfe.sg @@ -1,8 +1,9 @@ \selectlanguage{french} \songcolumns{2} \beginsong{Nanana de l'elfe} - [by=Le Donjon de Naheulbeuk] + [by=Le Donjon de Naheulbeuk,cov=t-as-pas-le-niveau,album=T'as pas le niveau] + \cover \gtab{D}{XX0232} \gtab{A}{X02220} \gtab{G}{320003} diff --git a/songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg b/songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg index c7b0cb37..fc044243 100644 --- a/songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg +++ b/songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg @@ -1,8 +1,9 @@ \selectlanguage{french} \songcolumns{2} \beginsong{Noël en Mordor} - [by=Le Donjon de Naheulbeuk] + [by=Le Donjon de Naheulbeuk,cov=t-as-pas-le-niveau,album=T'as pas le niveau] + \cover \capo{3} \gtab{Am}{X02210} \gtab{C}{X32010} diff --git a/songs/Le_Donjon_de_Naheulbeuk/grimoire-audio.jpg b/songs/Le_Donjon_de_Naheulbeuk/grimoire-audio.jpg index 35b9d78f..47da0b09 100644 Binary files a/songs/Le_Donjon_de_Naheulbeuk/grimoire-audio.jpg and b/songs/Le_Donjon_de_Naheulbeuk/grimoire-audio.jpg differ diff --git a/songs/Le_Donjon_de_Naheulbeuk/t-as-pas-le-niveau.jpg b/songs/Le_Donjon_de_Naheulbeuk/t-as-pas-le-niveau.jpg new file mode 100644 index 00000000..cd2c39dc Binary files /dev/null and b/songs/Le_Donjon_de_Naheulbeuk/t-as-pas-le-niveau.jpg differ diff --git a/songs/Los_Lobos/Rango_theme_song.sg b/songs/Los_Lobos/Rango_theme_song.sg index 76043dfa..06a9575c 100644 --- a/songs/Los_Lobos/Rango_theme_song.sg +++ b/songs/Los_Lobos/Rango_theme_song.sg @@ -5,63 +5,66 @@ \cover \gtab{Dm}{5:X02210} - \gtab{Am}{5:022000} + \gtab{A7}{5:020100} \gtab{B&}{6:022100} \gtab{F}{1:022100} - \gtab{C}{X32010} - \gtab{G}{3:022100} + \gtab{Gm}{3:022000} \begin{verse} From \[Dm]out of the dust Came a man true and bold - Champion of the fan\[Am]dango + Champion of the fan\[A7]dango \end{verse} \begin{verse*} - By \[Dm]night he drank \[Am]whiskey - By \[B&]day killed bad \[Dm]men - And the \[F]townspeople \[C]knew him as \[Dm]Rango + By \[B&]night he drank \[F]whiskey + By \[Gm]day killed bad \[Dm]men + And the \[F]townspeople \[A7]knew him as \[Dm]Rango \end{verse*} - \begin{verse} - Comin' down the mountainside - The people hailed his name - And of his legend they sang oh - \end{verse} + \begin{repeatedchords} + \begin{verse} + \[Dm]Comin' down the mountainside + The people hailed his name + And of his legend they \[A7]sang oh + \end{verse} - \begin{verse*} - With iron in his heart - Steel in his claw - He pumped their heads all full of lead, Rango - \end{verse*} + \begin{verse*} + With \[B&]iron in his \[F]heart + \[Gm]Steel in his \[Dm]claw + He \[F]pumped their heads all \[A7]full of lead, \[Dm]Rango + \end{verse*} + \end{repeatedchords} \begin{chorus} - Ran\[G]go, Ran\[Dm]go - Ran\[G]go, Ran\[F]go \[C Dm] + Ran\[B&]go, Ran\[Dm]go + Ran\[B&]go, Ran\[F]go \[A7 Dm] \end{chorus} - \begin{verse} - A ladies man indeed - From his head down to his knees - Rango was doing the tango - \end{verse} + \begin{repeatedchords} + \begin{verse} + A \[Dm]ladies man indeed + From his head down to his knees + Rango was doing the \[A7]tango + \end{verse} - \begin{verse*} - But in came bad Bill - From his hide out in the hill - With a notion to kill Rango - \end{verse*} + \begin{verse*} + But \[B&]in came bad \[F]Bill + From his \[Gm]hide out in the \[Dm]hill + With a \[F]notion to kill \[A7] \[Dm]Rango + \end{verse*} - \begin{verse} - Now Rango, he is gone - But his legend still lives on - In the brothels and saloons of Durango - \end{verse} + \begin{verse} + Now \[Dm]Rango, he is gone + But his legend still lives on + In the brothels and saloons of Du\[A7]rango + \end{verse} - \begin{verse*} - He lived as he died - A six gun at his side - And all the ladies cried for Rango - \end{verse*} + \begin{verse*} + He \[B&]lived as he \[F]died + A \[Gm]six gun at his \[Dm]side + And \[F]all the ladies cried \[A7] for \[Dm]Rango + \end{verse*} + \end{repeatedchords} \endsong diff --git a/templates/ancient.tmpl b/templates/ancient.tmpl index 30075990..e9519136 100644 --- a/templates/ancient.tmpl +++ b/templates/ancient.tmpl @@ -31,7 +31,7 @@ %%: {"name":"lang", "description":"Language", "default":"english"}, %%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]}, %%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, -%%: {"name":"version", "description":"Version", "default":"3.5.6"}, +%%: {"name":"version", "description":"Version", "default":"3.5.7"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, %%: {"name":"mail", "description":"Email", "default":"crep@team-on-fire.com"}, diff --git a/templates/patacrep-en.tmpl b/templates/patacrep-en.tmpl index c0f4134f..249e8af0 100644 --- a/templates/patacrep-en.tmpl +++ b/templates/patacrep-en.tmpl @@ -31,7 +31,7 @@ %%: {"name":"lang", "description":"Language", "default":"english"}, %%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]}, %%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, -%%: {"name":"version", "description":"Version", "default":"3.5.6"}, +%%: {"name":"version", "description":"Version", "default":"3.5.7"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, %%: {"name":"mail", "description":"Email", "default":"crep@team-on-fire.com"}, diff --git a/templates/patacrep.tmpl b/templates/patacrep.tmpl index 1e6353f1..ce73d888 100644 --- a/templates/patacrep.tmpl +++ b/templates/patacrep.tmpl @@ -31,7 +31,7 @@ %%: {"name":"lang", "description":"Language", "default":"french"}, %%: {"name":"instruments", "description":"Instruments", "type":"flag", "values":["guitar","ukulele"], "join":",", "mandatory":true, "default":["guitar"]}, %%: {"name":"bookoptions", "description":"Options", "type":"flag", "values":["diagram","importantdiagramonly","lilypond","pictures","tabs","repeatchords","onesongperpage"], "join":",", "mandatory":true, "default":["diagram","pictures"]}, -%%: {"name":"version", "description":"Version", "default":"3.5.6"}, +%%: {"name":"version", "description":"Version", "default":"3.5.7"}, %%: {"name":"subtitle", "description":"Subtitle"}, %%: {"name":"web", "description":"Web", "default":"http://www.patacrep.com"}, %%: {"name":"mail", "description":"Email", "default":"crep@team-on-fire.com"}, diff --git a/utils/resize-cover.py b/utils/resize-cover.py index 975c2386..c7f9daf3 100755 --- a/utils/resize-cover.py +++ b/utils/resize-cover.py @@ -8,14 +8,30 @@ import Image import glob -width = 128 -height = 128 - # Process song files covers = glob.glob('songs/*/*.jpg') for filename in covers: + source = Image.open(filename) - if source.size > (128, 128): - print "resizing : " + filename + + src_width = source.size[0] + src_height = source.size[1] + ratio = float(src_height) / float(src_width) + + width = 128 + height = 128 + error = 0.2 #0: always preserve ratio; 1: always square images + + #tolerate almost square images + if ratio < 1 - error or ratio > 1 + error: + #print "preserve ratio = ", ratio + #preserve important ratio + if src_width < src_height: + height = int(width * ratio) + elif src_height < src_width: + width = int(height * ratio) + + if src_width > width and src_height > height: + print "resize: ", filename, " from ", source.size, " to ", (width, height) target = source.resize((width, height), Image.ANTIALIAS) target.save(filename)