Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 04/08/2020, à 08:35

Kasskoul

Imagemagick bug : Resize des images non possible (problème de cache)

J'essaie de resize en ligne de commande des images par lot batch, mais je ne peux pas avec les commandes que je connais, de ce fait je ne sais pas comment modifier la capacité du cache.

warka@warka-HP-Pavilion-g6-Notebook-PC:~$ convert -resize 1024X768 /home/warka/Documents/jpg/*.jpg /home/warka/Documents/jpg/
IMG_20200803_163239.jpg  IMG_20200803_185425.jpg  IMG_20200803_190610.jpg
IMG_20200803_175549.jpg  IMG_20200803_185429.jpg  IMG_20200803_192417.jpg
IMG_20200803_183858.jpg  IMG_20200803_185432.jpg  IMG_20200803_192518.jpg
IMG_20200803_184814.jpg  IMG_20200803_185446.jpg  resizemediapart1/
IMG_20200803_184817.jpg  IMG_20200803_190035.jpg  
IMG_20200803_185019.jpg  IMG_20200803_190049.jpg  
warka@warka-HP-Pavilion-g6-Notebook-PC:~$ convert -resize 1024X768 /home/warka/Documents/jpg/*.jpg /home/warka/Documents/jpg/resizemediapart1/*.jpg
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_192518.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_163239.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_175549.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_183858.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_184814.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_184817.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185019.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185425.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185429.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185432.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185446.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190035.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190049.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190610.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_192417.jpg' @ error/cache.c/OpenPixelCache/4083.
warka@warka-HP-Pavilion-g6-Notebook-PC:~$ convert -resize 70% /home/warka/Documents/jpg/*.jpg /home/warka/Documents/jpg/resizemediapart1/*.jpg
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_192518.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_163239.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_175549.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_183858.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_184814.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_184817.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185019.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185425.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185429.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185432.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_185446.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190035.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190049.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_190610.jpg' @ error/cache.c/OpenPixelCache/4083.
convert-im6.q16: cache resources exhausted `/home/warka/Documents/jpg/IMG_20200803_192417.jpg' @ error/cache.c/OpenPixelCache/4083.
warka@warka-HP-Pavilion-g6-Notebook-PC:~$ convert -list resource
Resource limits:
  Width: 16KP
  Height: 16KP
  List length: 18.446744EP
  Area: 128MP
  Memory: 256MiB
  Map: 512MiB
  Disk: 1GiB
  File: 768
  Thread: 2
  Throttle: 0
  Time: unlimited
warka@warka-HP-Pavilion-g6-Notebook-PC:~

voici la configuration de mon portable https://pastebin.com/iAEVUemz ◎[▪‿▪]◎

Hors ligne

#2 Le 04/08/2020, à 17:30

abelthorne

Re : Imagemagick bug : Resize des images non possible (problème de cache)

C'est un problème connu d'ImageMagick, les ressources mémoire allouées sont assez faibles et ça peut vite poser problème quand on manipule de grosses images ou de nombreuses en masse.

Il faut modifier son fichier de config, qui est uniquement au niveau système (donc avec les droits admin). C'est le fichier /etc/ImageMagick-6/policy.xml. Tu peux l'ouvrir par exemple avec Nano :

sudo nano /etc/ImageMagick-6/policy.xml

Une fois les modifs effectuées, pour enregistrer : ctrl + O, valide le nom de fichier, puis ctrl + X pour fermer Nano.

Tu peux trouver un exemple de config là : https://www.imagemagick.org/discourse-s … hp?t=34044 (dans le troisième message). À ajuster en fonction de ta RAM. Les lignes entre "<!--" et "-->" sont en commentaires (désactivées).

Sinon, pour redimensionner des images en masse (si elles sont toutes dans le même dossier), tu peux aussi passer par gThumb (pas en ligne de commande).

Dernière modification par abelthorne (Le 04/08/2020, à 17:30)

Hors ligne

#3 Le 04/08/2020, à 18:53

moko138

Re : Imagemagick bug : Resize des images non possible (problème de cache)

Est-ce que tu as encore un message d'erreur en procédant comme ceci :

a) On crée un autre répertoire de destination, vide (pour ne pas toucher à l'existant)

mkdir -v /home/warka/Documents/jpg/resizemediapart2

            .
b) puis

find /home/warka/Documents/jpg -maxdepth 1 -type f -iname \*.jpg  -exec mogrify -resize 1024x768  -path /home/warka/Documents/jpg/resizemediapart2 '{}' \;

?


Remarque : cette méthode conserve les noms d'origine (même s'ils contiennent des espaces).


%NOINDEX%
Un utilitaire précieux : ncdu
Photo, mini-tutoriel :  À la découverte de dcraw

Hors ligne