LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sorting images by dimension in Fedora 11 (https://www.linuxquestions.org/questions/linux-newbie-8/sorting-images-by-dimension-in-fedora-11-a-767455/)

thezerodragon 11-06-2009 10:51 PM

sorting images by dimension in Fedora 11
 
My Friends,

Please excuse me if it seems like I'm wasting your time, but I'd like to take a second to thank you all for your support and patience during my transition to linux. I couldn't have done it without this forum.

Anyway, what I'm looking to do is rather simple, and I'm embarrassed I need to ask which program to use to do this. I run KDE and dolphin doesn't give me any options in folders full of images to sort by dimension. I just want to skim out all the ones that are 1280 by 1024 or larger. Is there a command for this?

ghostdog74 11-07-2009 12:20 AM

you can see here for similar example, change the values as needed

thezerodragon 11-13-2009 08:17 PM

I appreciate your help, but this didn't work for me. I copied the command, put in the appropriate directory, and hit enter but nothing happened. I also don't know what the appropriate command would be as I don't want to resiwe them, just move them if they're over a certain size.

John VV 11-13-2009 08:31 PM

that full script is for RESIZING images using imagemagick
the part ghostdog74 is talking about is
Code:

  if ( arr[1] > 200 && arr[2] > 200 ) {
part where 200 is the image size

you need to wright your own script to select images bigger than 1024

PS. DO NOT GO AROUND AND RUN RANDOM SCRIPTS posted by people one of them just might have you deleting your OS like this "rm -f / "

ghostdog74 11-13-2009 08:44 PM

Quote:

Originally Posted by thezerodragon (Post 3756439)
I appreciate your help, but this didn't work for me. I copied the command, put in the appropriate directory, and hit enter but nothing happened. I also don't know what the appropriate command would be as I don't want to resiwe them, just move them if they're over a certain size.

i said its similar, i did not say its exactly what you want. you just want to skim out the dimensions right? so the if() statement does just that. change the values as needed. if you want to move them, just do
Code:

if ( ... ) {
  cmd = "mv "$1" /destination"
  system(cmd)
}


ghostdog74 11-13-2009 08:45 PM

Quote:

Originally Posted by John VV (Post 3756453)

PS. DO NOT GO AROUND AND RUN RANDOM SCRIPTS posted by people one of them just might have you deleting your OS like this "rm -f / "

only if they have the naive assumption that everything works exactly if they cut and paste, and are too lazy to read the source code and understand what it does.

John VV 11-13-2009 09:31 PM

ghostdog74
i still like the bash "fork" script .
and NO i will not post that,it is way to wicked .

thezerodragon
you might want to learn some shell scripting
some guides
http://www.linuxcommand.org/index.php
http://www.linuxcommand.org/writing_shell_scripts.php

Linus IS NOT like MS Windows not everything is done using a GUI

ghostdog74 11-13-2009 09:57 PM

Quote:

Originally Posted by John VV (Post 3756495)
ghostdog74
i still like the bash "fork" script .
and NO i will not post that,it is way to wicked .

its already written and discussed in computer security books and published to the whole world.

John VV 11-13-2009 10:03 PM

true but i think it is one of the baned things on the forum

i am getting way off topic

he will still need ImageMagick installed so that "-identify" can be used

ghostdog74 11-13-2009 10:12 PM

Quote:

Originally Posted by John VV (Post 3756515)
he will still need ImageMagick installed so that "-identify" can be used

any tool that reads images and get their meta is fine. Its just that i have ImageMagick with me, hence the solution. if OP wants, he can even program in languages like Perl or Python and install modules specifically for that.


All times are GMT -5. The time now is 12:52 AM.