Guest User

Untitled

a guest
May 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. % find . -type f -print0 | xargs -0 -I{} file --mime-type {}
  2. ./foo
  3. bar.png: image/png
  4. ./OWoHp.png: image/png
  5. ./J7ZwV.png: image/png
  6. ./foo.txt: inode/x-empty
  7. ./bar: inode/x-empty
  8. ./hUXnc.png: image/png
  9.  
  10. % ls foo$'n'bar.png
  11. foo?bar.png
  12.  
  13. % find . -type f -print0 | xargs -0 -I{} file --mime-type {} | awk -F$"" -F": " '/image/ {print $1}'
  14. bar.png
  15. ./OWoHp.png
  16. ./J7ZwV.png
  17. ./hUXnc.png
  18.  
  19. % find . -type f -print0 | xargs -0 -I{} file --mime-type {} | awk -F$"" -F":" '/image/ {print $1}' | xargs -I{} identify -format "%[fx:w*h] %in" {}
  20. identify: unable to open image `bar.png': No such file or directory @ error/blob.c/OpenBlob/2709.
  21. identify: unable to open file `bar.png' @ error/png.c/ReadPNGImage/3922.
  22. 26696 ./OWoHp.png
  23. 47275 ./J7ZwV.png
  24. 37975 ./hUXnc.png
  25.  
  26. ./foo
  27. bar.png
  28.  
  29. find . -type f -exec sh -c 'file --brief --mime-type "$0" |
  30. grep -q ^image/ && identify -format "%[fx:w*h] %in" "$0"' {} ;
  31.  
  32. exiftool -q -if '$mimetype =~ /image/' -p '$megapixels $directory/$filename' -r .
  33.  
  34. find . -type f -print0 |
  35. while IFS= read -rd "" filename; do
  36. type=$( file --brief "$filename" )
  37. if [[ $type == *image* ]]; then
  38. identify -format "%[fx:w*h] %in" "$filename"
  39. fi
  40. done
  41.  
  42. find . -type f -print0 | while IFS= read -r -d '' file; do
  43. file --mime-type "$file" | grep -qP "bimage/" &&
  44. printf '%s %s' $(identify -format '%[fx:w*h]' "$file") "$file";
  45. done | sort -gz | tr '' 'n'
  46. 256 ./file 10
  47. 256 ./file 15
  48. 484 ./file 16
  49. 576 ./file 11
  50. 576 ./file 17
  51. 1024 ./file 12
  52. 1024 ./file 19
  53. 2304 ./file 13
  54. 5625 ./file 14
  55. 15190 ./file 2
  56. 15680 ./file 1
  57. 16384 ./file 9
  58. 65536 ./file 18
  59. 145200 ./file 0
  60. 183531 ./file 6
  61. 364807 ./file
  62. 3
  63. 364807 ./file 4
  64. 364807 ./file 5
  65. 388245 ./file 8
  66. 550560 ./file 7
Add Comment
Please, Sign In to add comment