Skip to main content
typo
Source Link
sebasth
  • 15.8k
  • 6
  • 53
  • 71

You could combine identify with find, for example:

find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -type f -iname "*.jgp"jpg" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'

You could combine identify with find, for example:

find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -type f -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'

You could combine identify with find, for example:

find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'
typo
Source Link
sebasth
  • 15.8k
  • 6
  • 53
  • 71

You could combine identify with find, for example:

find . -type f -iname "*.jgp"jpg" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -type f -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'

You could combine identify with find, for example:

find . -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'

You could combine identify with find, for example:

find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -type f -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'
Source Link
sebasth
  • 15.8k
  • 6
  • 53
  • 71

You could combine identify with find, for example:

find . -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \;

which will run your identify command for every file recursively found with name ending in .jpg (case-insensitive).

Using your full example:

find . -iname "*.jgp" -exec identify -format '%w %h %i\n' {} \; |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' |
tr '\n' '\0' |
xargs -0 mogrify -resize '1200x1200'