Sponsored Content
Top Forums Shell Programming and Scripting How to find & auto resize images? Post 302909157 by mirni on Tuesday 15th of July 2014 02:59:20 AM
Old 07-15-2014
No, you don't have it correctly. There are a couple problems with your line:
1. convert takes 2 filenames:
Code:
convert <inputfile> <outputfile>

If you want to perform the operation on the same file, use mogrify instead.
Note that this will overwrite the original file!

2. You are not passing the filenames that find prints to convert. This is done using {}. E.g.
Code:
 find . -type f -name "*.jpg" -exec convert -resize '>736' {} {}.resized \;

But that will keep the suffix, so file image.jpg will become image.jpg.resized.
When renaming with find, it is safer and more convenient to create a script and then do -exec myscript.sh {} \; on a whole set of files.
At first your script can echo the command you are going to run, then you verify the terminal output that it looks right, test it on one or few files and then run it on the whole set.

If you are sure you want to overwrite your inputs, just use mogrify:
Code:
find . -type f -name ..... -exec mogrify -resize '>736' {} \;


I don't know what '>736' specifier means. I assume you got that correct.
This User Gave Thanks to mirni For This Post:
 

9 More Discussions You Might Find Interesting

1. Programming

curses & window resize issues

I am writing a program to display a database to the screen(xterm) and want to allow the window resize signal to increase/decrease the amount data that is displayed. I have a signal handler function for catching the SIGWINCH event and calling a function to reallocate the space for the windows... (0 Replies)
Discussion started by: kwaz
0 Replies

2. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

3. Shell Programming and Scripting

Synchronize pictures & resize at the same time

Hi, I"m trying to achieve the following: I have a NAS which holds all my pictures, and have it mounted on my xbmc as a network share. I want to automatically synchronize my pictures (NAS -> xbmc, one direction). But, during the synchronization I want to resize the pictures to make them... (7 Replies)
Discussion started by: Joeba
7 Replies

4. Linux

awk filter & Auto gen Mail

hi experts 2012-01-30 10:30:01:812 "y" "NA" "30/01/2012 10:30:01:154 AM" 2012-01-30 10:33:46:342 "y" "NA" "30/01/2012 10:33:45:752 AM" 2012-01-30 10:41:11:148 "n" "200" "30/01/2012 10:41:10:558 AM" 2012-01-30 10:44:48:049 "y" "NA" ... (7 Replies)
Discussion started by: nith_anandan
7 Replies

5. Shell Programming and Scripting

Find all images, append unique prefix to name and move to different directory

Hi, I have a directory with Multiple subdirectories and 1000s of pictures (jpg) in each directory. The problem is that each directory has a 001.jpg in them. I want to append a unique name (the directory_name)would be fine. and then move them to one main backup directory once they have been... (1 Reply)
Discussion started by: kmaq7621
1 Replies

6. Shell Programming and Scripting

resize images

Is there a script or extension that I can look into that will re-size an allotment of images to a given size?? Id like to take images of a certain size and resize them but Im dont remember an install option that can do it if installed in ubuntu but I, also unsure in what code I will have to learn.... (2 Replies)
Discussion started by: graphicsman
2 Replies

7. Shell Programming and Scripting

Want to resize images for a specific size on server - Please help

,,,,,, (4 Replies)
Discussion started by: Praveen Pandit
4 Replies

8. UNIX for Dummies Questions & Answers

How to find string of file name of images?

Hi & good day, How to use find correctly ? I have several folders, _img1, _img2 etc. Then I want to use the find command to find part of an image name, such as: the string ”modern” which is (at least) in: ”_img2/modern_world2PS220.jpg” Also I want to know _in which folder_ it... (10 Replies)
Discussion started by: OmarKN
10 Replies

9. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies
pilot-foto(1)							    PILOT-LINK							     pilot-foto(1)

NAME
pilot-foto - Palm 'Foto' Image Installer/Remover/Fetcher/Converter SECTION
pilot-link: Userland conduits SYNOPSIS
pilot-foto [-p|--port <port>] [--version] [-?|--help] [-q|--quiet] [--usage] [-d|--delete] [--delete-all] [-i|--install] [-l|--list] [-f|--fetch] [-F|--fetch-all] [-c|--convert] DESCRIPTION
This is a palm conduit to fetch, install, or remove, Foto files from a Palm. It can also convert *.jpg.pdb files that have already been fetched from the Palm to jpeg files. Delete all, or named fotos from handheld. Install one, or many jpeg images to handheld. List all jpeg files and thumbnails on handheld. Fetch all jpeg files, or certain ones by name. Tries to detect if a file really is a jpeg and refuses to install it, if it is not. pilot-foto allows you to do multiple operations in one sync. For instance, delete test.jpg and install test.jpg. USAGE
pilot-foto -p <port> [options] file OPTIONS
pilot-foto options -d, --delete Delete a jpg file on the handheld --delete-all Delete ALL jpg files on the handheld -i, --install Install a jpg file -l, --list List all photos and thumbnails -f, --fetch Fetch files from the Palm -F, --fetch-all Fetch ALL jpg files from the Palm -c, --convert convert [file].jpg.pdb files to jpg Conduit Options -p, --port port Use device file port to communicate with the Palm handheld. If this is not specified, pilot-foto will look for the $PILOTPORT environment variable. If neither are found or supplied, pilot-foto will print the usage information. -q, --quiet Suppress 'Hit HotSync button' message -v, --version Display version of pilot-foto and exit without connecting. Help Options -h, --help Display the help synopsis for pilot-foto and exit without connecting. --usage Display a brief usage message and exit without connecting. EXAMPLES
Examples: pilot-foto -p /dev/pilot -f pilot-foto -d MyImage.jpg pilot-foto -i MyImage.jpg pilot-foto -i *.jpg pilot-foto -f MyImage pilot-foto -c MyImage.jpg.pdb PROBLEMS
Palm has not published their database format for the thumbnails. So, pilot-foto puts a generic penguin thumbnail for every image uploaded. Fotos can be accessed by a named list on the handheld as well as the thumbnails. This has been tried on a couple of handhelds. It is possi- ble that a foreign palm or different model will not like it. To get a thumbnail image you can copy the jpegs to the memory card. If you copy them back to the handheld they will have a new thumbnail that matches the jpeg. AUTHOR
This manual page was converted to XML by Neil Williams <linux@codehelp.co.uk> BUGS
If a jpeg is installed with the same name as one already on the palm you will have 2 thumbnails pointing to the same jpeg. The new jpeg will overwrite the old jpeg. If the thumbnail fails to install then the jpeg should be removed. It is not. We have an online bug tracker. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed. Reporting bugs via email, while easy, is not very useful in terms of accountability. Please point your browser to http://bugs.pilot-link.org: http://bugs.pilot-link.org and report your bugs and issues there. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. SEE ALSO
pilot-link(7) 0.12.5 Copyright 1996-2007 FSF pilot-foto(1)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy