tag:blogger.com,1999:blog-6305030.post115230126869498418..comments2024-03-15T10:20:34.198-07:00Comments on Rhosgobel: Radagast's home: Bulk resizing and renaming images in Ubuntu - The Resize_images Nautilus scriptRadagasthttp://www.blogger.com/profile/01419540565463343922noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6305030.post-17074475787082604042010-05-13T12:03:10.029-07:002010-05-13T12:03:10.029-07:00Importing comments:
Teddi B
thanks so much! this...Importing comments:<br /><br />Teddi B <br />thanks so much! this was quick and easy and really helped me out! <br /> <br />teddi b <br />www.teddi-b-poetic.com<br />March 26, 2010, 3:25:48 PM PDT – Like – Reply<br /><br />Josh <br />Great script.. works perfectly in gutsy! Many thanks!<br />May 19, 2008, 1:59:45 PM PDT – Like – Reply<br /><br />John McDougall <br />I just came across your Resize_images script. What a very useful tool. Thanks. It will make it a lot easier to post pictures on the web. <br />John<br />May 16, 2008, 12:21:13 PM PDT – Like – Reply<br /><br />Dick Dunbar <br />Just wanted to let you know that I've been using variations on this script for months now, and it's great. I removed the renaming of the files, as I didn't want that. The problem I originally had with NFS files turned out to be a Gnome/Nautilus problem, which is fixed in Ubuntu 8.04 (Hardy). Thanks again for your efforts. This is one of my most heavily used pieces of code, as I maintain a photo gallery website, and am resizing batches of photos all the time.<br />May 7, 2008, 9:28:20 AM PDT – Like – Reply<br /><br />Harrie <br />This works great for me on Edgy. Thank you so much!<br />November 4, 2007, 2:35:44 PM PSTRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-44667744052244284202010-05-13T12:02:53.505-07:002010-05-13T12:02:53.505-07:00Importing comments:
Chris Collins
Chris Collins
V...Importing comments:<br /><br />Chris Collins<br />Chris Collins<br />Visit me on...<br />ccollins.us<br /> <br />code did not come through right. sorry <br /> <br />Replaced! <br />[code] <br />convert -quality 80 -resize $imgsize "$picture" $imgsizedir/"$picture" <br /># rename the created file - there's got to be an easier way to handle all cases. <br />rename s/.JPG$/_$niceimgsize.JPG/ $imgsizedir/"$picture" <br />rename s/.jpg$/_$niceimgsize.jpg/ $imgsizedir/"$picture" <br />rename s/.JPEG$/_$niceimgsize.JPEG/ $imgsizedir/"$picture" <br />rename s/.jpeg$/_$niceimgsize.jpeg/ $imgsizedir/"$picture" <br />rename s/.GIF$/_$niceimgsize.GIF/ $imgsizedir/"$picture" <br />rename s/.gif$/_$niceimgsize.gif/ $imgsizedir/"$picture" <br />rename s/.PNG$/_$niceimgsize.PNG/ $imgsizedir/"$picture" <br />rename s/.png$/_$niceimgsize.png/ $imgsizedir/"$picture" <br />[/code] <br /> <br />with <br /> <br />[code] <br />basename=`basename "$picture"` <br /># everything after last '/' <br />basename=code did not come through right. sorry Replaced! [code] convert -quality 80 -resize $imgsize "$picture" $imgsizedir/"$picture" # rename the created file - there's got to be an easier way to handle all cases. rename s/.JPG$/_$niceimgsize.JPG/ $imgsizedir/"$picture" rename s/.jpg$/_$niceimgsize.jpg/ $imgsizedir/"$picture" rename s/.JPEG$/_$niceimgsize.JPEG/ $imgsizedir/"$picture" rename s/.jpeg$/_$niceimgsize.jpeg/ $imgsizedir/"$picture" rename s/.GIF$/_$niceimgsize.GIF/ $imgsizedir/"$picture" rename s/.gif$/_$niceimgsize.gif/ $imgsizedir/"$picture" rename s/.PNG$/_$niceimgsize.PNG/ $imgsizedir/"$picture" rename s/.png$/_$niceimgsize.png/ $imgsizedir/"$picture" [/code] with [code] basename=`basename "$picture"` # everything after last '/' basename=${picture##*/} tempbasename="$imgsize"_"$basename" dirname=`dirname "$picture"` dirname="$dirname/$imgsizedir" convert -quality 80 -resize $imgsize "$picture" $dirname/"$tempbasename" # rename the created file - there's got to be an easier way to handle all cases. mv $dirname/$tempbasename $dirname/$basename [/code]#123;picture##*/} <br />tempbasename="$imgsize"_"$basename" <br />dirname=`dirname "$picture"` <br />dirname="$dirname/$imgsizedir" <br />convert -quality 80 -resize $imgsize "$picture" $dirname/"$tempbasename" <br /># rename the created file - there's got to be an easier way to handle all cases. <br />mv $dirname/$tempbasename $dirname/$basename <br />[/code]<br />September 24, 2007, 12:53:51 PM PDTRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-58653761834281942972010-05-13T12:02:35.324-07:002010-05-13T12:02:35.324-07:00Importing comments (second half of post): # get ex...Importing comments (second half of post): # get extension; everything after last '.' <br />ext=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file##*.} <br /> <br /># basename <br />basename=`basename "$file"` <br /># everything after last '/' <br />basename=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file##*/} <br /> <br /># dirname <br />dirname=`dirname "$file"` <br /># everything before last '/' <br />basename=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file%/*} <br />[/code]<br />September 24, 2007, 12:51:14 PM PDTRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-27020774625215108362010-05-13T12:01:51.879-07:002010-05-13T12:01:51.879-07:00Importing comments (part 1 of a post)
Chris Colli...Importing comments (part 1 of a post)<br /><br />Chris Collins <br />Great job! <br />I added this to my Feisty using KDE <br />I had to make some adjustments to get it to work with Konqueror. <br />Since Konqueror passes the files to the script with the full path I changed the <br />convert and rename lines. <br /> <br />replaced <br />[code] <br /># set the 'file' variable first <br /> <br /># get extension; everything after last '.' <br />ext=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file##*.} <br /> <br /># basename <br />basename=`basename "$file"` <br /># everything after last '/' <br />basename=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file##*/} <br /> <br /># dirname <br />dirname=`dirname "$file"` <br /># everything before last '/' <br />basename=Great job! I added this to my Feisty using KDE I had to make some adjustments to get it to work with Konqueror. Since Konqueror passes the files to the script with the full path I changed the convert and rename lines. replaced [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code] with [code] # set the 'file' variable first # get extension; everything after last '.' ext=${file##*.} # basename basename=`basename "$file"` # everything after last '/' basename=${file##*/} # dirname dirname=`dirname "$file"` # everything before last '/' basename=${file%/*} [/code]#123;file%/*} <br />[/code] <br />with <br />[code] <br /># set the 'file' variable firstRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-35041766512133353262010-05-13T11:59:56.826-07:002010-05-13T11:59:56.826-07:00Importing comments:
Josh
This is a wonderful scr...Importing comments:<br /><br />Josh <br />This is a wonderful script. Works like a charm. Thanks for your time and effort and eagerness to share.<br />June 18, 2007, 11:47:45 AM PDT – Like – Reply<br /><br />Dick Dunbar <br />OK, I have more info now. I finally realized that the USB drive I tried to use was a Windows drive mounted as read-only. When I tried the same thing on a local writeable linux USB drive, it worked fine. The script should probably have error detection added to catch that, but I can deal with that. I just tried the script on a NAS drive mounted via SMB, and it worked fine on that (I have a lot of oddball things on my network). The only unexplained thing left is why the selected files can't be seen on an NFS mounted volume.<br />June 13, 2007, 7:53:20 PM PDT – Like – Reply<br /><br />Radagast <br />Dick: That's odd. I just tried using the script on my USB drive (here in Feisty), and the script seems to work fine. However, I don't have an NFS mount here, so can't test that. <br /> <br />The script assumes it's working in the current Nautilus directory (i.e., all commands assume they're running in the directory the pictures are in), so it could be that the script (for some reason) isn't executing in the same directory that you're selecting the pictures in. Hmm. <br /> <br />I'm sorry that I can't help more. Let me know if you find a solution!<br />June 13, 2007, 2:55:00 PM PDT – Like – Reply<br /><br />Dick Dunbar <br />Whoops! I kind of found out what the problem was. It works fine if the images selected are on a local disk, like in the home directory. If the files are on a USB drive, it seems to work, but I can't find the directory with the resized images. If the files are on an NFS attached drive, it can't see the selected files. Anybody got a way around that?<br />June 12, 2007, 2:16:43 PM PDT – Like – Reply<br /><br />Dick Dunbar <br />This was exactly what I was looking for, but I can't get it to work. I'm running Edgy, and I installed everything exactly as stated, but somehow it doesn't see my file selections. I bring up the file browser, select a number of files, then right click and select the script, and I get the error display that says no files were selected. Any ideas?<br />June 12, 2007, 2:03:12 PM PDTRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-82019399156197270652010-05-13T11:59:41.690-07:002010-05-13T11:59:41.690-07:00Importing comments:
Radagast
I've just poste...Importing comments:<br /><br />Radagast <br />I've just posted a new version of the script (here) that should be usable on Edgy. I only have Dapper here, though, so if users of Edgy could let me know if it works I'd appreciate it.<br />February 19, 2007, 11:45:38 PM PST – Like – Reply<br /><br />Radagast <br />Thanks for hunting that down!<br />February 19, 2007, 10:35:53 PM PST – Like – Reply<br /><br />dave <br />Just thought I would let you know I figured out my problem. Actually I just found the solution provided by someone else. The author of the original script "NIS" has revised it to be compatible with the edgy distro, that was apparently my problem. You can check out his revision here. <br />http://www.creationgif.com/debian/nis/ <br /> <br />Thanks for your work on this, <br />Dave<br />February 15, 2007, 7:32:20 PM PST – Like – Reply<br /><br />Radagast <br />I'd be happy to work on updating the script, but unfortunately don't know what the problem is. At least one of the commenter's problems was a result of dependency problems, but I don't know what the problem is if the dependencies are there. <br /> <br />Sounds like embedding some debugging code is called for ...<br />February 13, 2007, 9:43:42 PM PST – Like – Reply<br /><br />dave <br />Are you still supporting this script? <br />I have the same problem as bohemian above. The resize dialog box opens, I select a size for the selected file hit enter and nothing happens. I put the file in the scripts directory and made it executable. The dependencies are present. Do you have an update or any thoughts on what I may be doing wrong. this script appears to be just what I need would sure like to get it to work. <br />thanks <br />Dave<br />February 13, 2007, 8:31:09 PM PST – Like – Reply<br /><br />Radagast <br />Elbee - can you try running "convert" from the command line? That's the component of ImageMagick the script uses, and I'd like to see if that runs independently of the script. <br /> <br />I've sent you more details via e-mail.<br />December 30, 2006, 5:19:37 AM PSTRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.comtag:blogger.com,1999:blog-6305030.post-83511484092817220922010-05-13T11:59:19.088-07:002010-05-13T11:59:19.088-07:00Importing comments:
elbee
I'm running Dapper...Importing comments:<br /><br />elbee <br />I'm running Dapper, too. When running the script, the directory is being created, progress bar is being shown for a very short time,but the newly created directory remains empty. Any idea how to correct?<br />December 28, 2006, 10:39:22 AM PST – Like – Reply<br /><br />Radagast <br />Hi Bohemian, <br /> <br />Yep, the new folder should be created in the same folder as the images. I'm still running Dapper, so haven't been able to test it in Edgy. I can only think of one thing off the top of my head: Have you selected an image size to resize the images to before clicking "ok"? It will exit if no image size is selected. <br /> <br />I'm guessing that you have, and thus I'm not sure what's up. Does it show a progress bar as it resizes each image?<br />November 20, 2006, 9:39:33 AM PST – Like – Reply<br /><br />bohemian <br />Hi, <br /> <br />This script is exactly what I was looking for. But I might be really silly or confused, because I did install it as instructed and when I select an image it brings up the graphical interface to select the image size. But then I press OK and nothing happens (or nothing seems to happen). Where should I look for the new folder? In the same folder that I started? I run Ubuntu Edgy, and I am not sure if I've done something wrong. (All the depends are installed.) <br /> <br />Thanks<br />November 19, 2006, 1:50:09 AM PST – Like – Reply<br /><br />David C <br />Well done! <br /> <br />I've just added this to my Ubuntu 6.06 and it's great. <br /> <br />As you say the great thing about Open Source is that you can modify it, and you've done a good job, not least in then documenting it really well. <br /> <br />Cheers <br />David<br />August 23, 2006, 5:07:08 AM PDT – Like – Reply<br /><br />Nighto <br />Cool! You saved my life <br />August 20, 2006, 2:25:26 PM PDRadagasthttps://www.blogger.com/profile/01419540565463343922noreply@blogger.com