LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-16-2009, 12:57 AM   #1
fwc
LQ Newbie
 
Registered: Dec 2008
Posts: 19

Rep: Reputation: 0
errors in "convert" (image magick)


Hello, I was trying to reduce the quality of a folder of images (batch) to put on the web and wasn't sure which command to use. I downloaded image magick and went to the folder where the images were.

I had used mogrify to change the dimensions but then to change the quality I used "convert -quality 80% *.JPG" So I thought it was converting the quality of the images in that folder but after about 30 mins of processing with no sign of stopping I decided to abort (restart button, because screen was greyed out).

So when I came back none of the images in the folder had been changed. Can someone please help explain what actually happened? Thanks very much for any support.

Last edited by fwc; 02-16-2009 at 01:04 AM.
 
Old 02-16-2009, 01:39 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
The convert command accept both the input file name and the output file name as arguments:
Code:
convert input-file [options] output-file
Most likely the first image has been converted and the output has been overwritten onto the second image and so on. Hence to process multiple files better to use a for loop, like this:
Code:
for file in *.JPG
do
  convert "$file" -quality 80 "$file"
done
Moreover you don't need to apply the mogrify command before processing with convert, since you can use the -resize option of convert to achieve the same result.
 
Old 02-16-2009, 03:15 AM   #3
fwc
LQ Newbie
 
Registered: Dec 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
The convert command accept both the input file name and the output file name as arguments:
Code:
convert input-file [options] output-file
Most likely the first image has been converted and the output has been overwritten onto the second image and so on. Hence to process multiple files better to use a for loop, like this:
Code:
for file in *.JPG
do
  convert "$file" -quality 80 "$file"
done
Moreover you don't need to apply the mogrify command before processing with convert, since you can use the -resize option of convert to achieve the same result.
Thank you very much. I did not mean to imply that one has to use mogrify, but that was just the command I found online. It didn't seem to overwrite any files, but I am surprised it used so much processing power.
I converted the quality with mogrify and it seems to work better so I think I will use that. Thanks very much, and my main concern was that it had converted files outside the directory I was in.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to convert VMWare image to raw using Qemu: error - "image open" JamesHall Linux - Software 1 07-22-2008 04:59 AM
Thunderbird and Image Magick as a "helper app" dguy Linux - Desktop 3 02-06-2008 05:55 AM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 02:07 PM
FC4 install errors, "diabling IRQ #10" "nobody cares" error message??? A6Quattro Fedora 6 07-20-2005 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration