Page 1 of 1

[REQ]Réallocation images en masse

Posted: 2009-05-14 10:41:11
by Pinou
Bonjour à vous!

J'ai un dossier qui contient toutes mes affiches de film sous forme "titre original.jpg" mais, dans mon catalogue (xml), elles sont renseignées sous forme "titre formaté.jpg"
(ce n'est pas un bug du programme, j'ai simplement importé les images avec l'option titre formaté mais comme je les voulais avec le titre original uniquement... enfin voilà quoi!).

Donc je me demandais si il y avait moyen, via un script par exemple, de changer massivement le chemin relatif des images?
(enfin pas exactement puisque le path est bon, c'est juste le nom du fichier qui ne correspond pas)

Une autre piste que j'ai aussi essayée, c'est d'ouvrir le xml avec un éditeur de texte (notepad++) et de faire un rechercher/remplacer mais ça foire quelque peu...

En clair je suis un peu paumé et j'ai décidé de m'en remettre à vos innombrables talents!

Merci de m'avoir lu et à très vite j'espère :grinking:

Posted: 2009-05-15 16:45:13
by antp
Bonjour,
On ne peut pas contrôler les images par script malheureusement, donc a priori je ne vois pas trop comment faire ça autrement qu'en manipulant le fichier XML...

Posted: 2009-05-15 23:42:54
by Pinou
Aie!

Et bien, je vais tenter de trouver une solution (et je vous tiens au courant! ) :)

Merci quand même

Posted: 2009-05-16 00:20:15
by bad4u
Well, you could use AMC's scripting engine to manipulate the XML file.. ;)

Posted: 2009-05-16 05:10:24
by bonienl
Malheuresment mon français est três mal, donc je vous écrit en anglais :)

One way to rename all your images is by editing the XML file using a programme called "Editpad Pro". A free evaluation version you can download at http://www.editpadpro.com/download.html.

Once Editpad Pro is installed then press CTRL-F to show the search panel. Within this panel check the 'Regular Expression' option at the right side. This allows to do a search & replace based on expressions.

The following is entered for the search section (copy and paste this):

Code: Select all

<Movie(.+) OriginalTitle=(".+)" FormattedTitle=(".+)" Picture=".+(\.jpg"\/>)
The replace section gets the following:

Code: Select all

<Movie$1 OriginalTitle=$2" FormattedTitle=$3" Picture=$2$4
Do a "Replace All" and you are done! The above expressions will replace the name of the movie file to a file name equal to the original title. I assume your files end on .JPG - if not you must adapt the search string with your extension.

And don't forget to make a copy of your XML file, just in case :o

Bonne chance!

Posted: 2009-05-16 10:07:48
by Pinou
Thank you so much! :grinking: :grinking:

For me, the searching code was:

Code: Select all

<Movie(.+) OriginalTitle=(".+)" TranslatedTitle=(".+)" FormattedTitle=(".+)" Picture=".+(\.jpg"\/>)
And the replacing expression:

Code: Select all

<Movie$1 OriginalTitle=$2" TranslatedTitle=$3" FormattedTitle=$4" Picture=$2$5
After that, I got to reset the path of my pictures, launch amc and smile :D

Great job bonienl!