Tag Info

New answers tagged


Compressibility of a disk image depends a lot on what kind of data is stored in there, how much of it is used or has ever been used (without being explicitely erased during the whole life of that drive). In short, it's impossible to tell. 77% is completely plausible as are 0% (a disk full of videos/oggs) and 99% (an empty, recently erased with zeros disk). ...


Have a look at the Drawille library. It uses the UTF braille characters to draw pixels.


To convert all .png and .bmp in the current directory and then remove the original files: mogrify -format jpg -quality 100 ./*.{png,bmp} rm ./*.{png,bmp} To convert all files except .jpg, if your shell supports extended globbing, e.g. bash: shopt extglob mogrify -format jpg -quality 100 ./*.!(jpg) rm ./*.!(jpg) or zsh: setopt extended_glob mogrify ...


With zsh higher() { local h h=$(identify -format %h - < $REPLY) && ((h > $1)) } mogrify -resize 'x1900>' ./*.jpg(.e:higher 1900:)


#!/bin/bash file="" max=0 for f in /OEBPS/image/*{png,jpg,jpeg} do id=$(identify "$f") size=$(echo ${id} | sed -r 's/.* (JPEG|PNG) ([0-9]+)x([0-9]+) .*/\2*\3/') area=$(($size)) if (( area >= max )) then max=$area file="$f" fi done echo $max $file Don't use ls for iterating over files in scripts - blanks in filenames will brake ...


here's a way to get the height and width in one step: IFS=x read w h < <(identify "$file" | grep -oP '\d+x\d+(?=\+)') identify is part of the ImageMagick package. Your "$far" is surely not what you want: for dir in */OEBPS/image/; do for image in "$dir"/*.{jpg,png,jpeg}; do IFS=x read w h < <(identify "$image" | grep -oP ...

Top 50 recent answers are included