Piszę skrypt powłoki, aby ustalić, czy te duże pliki GIF mogą zostać zmniejszone do rozmiaru pliku do wykorzystania w Internecie, poprzez ich konwersję do plików JPG. Ten jeden GIF powoduje problem convert
. Tworzy 15 wersji GIF. convert
Ponownie uruchamiam polecenie z opcją -verbose, ale nie rozumiem, dlaczego traktuje ten GIF inaczej niż inne i dlaczego produkuje 15 wersji.
Plik GIF ma tylko 11 KB, więc nie martwię się, aby ten konkretny plik był JPEG, ponieważ jest już wystarczająco mały, ale próbuję zrozumieć, dlaczego convert
tak się zachowuje. Czy może używam go nieprawidłowo?
Uruchamiane convert
polecenie:
# convert -verbose Images/made_with_mac.gif /tmp/analyze_images/Images/made_with_mac.jpg
Images/made_with_mac.gif[0] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.009
Images/made_with_mac.gif[1] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[2] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[3] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[4] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[5] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[6] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[7] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[8] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[9] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[10] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[11] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[12] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[13] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif[14] GIF 88x31 88x31+0+0 8-bit sRGB 256c 11.4KB 0.000u 0:00.000
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-0.jpg[0] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.44KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-1.jpg[1] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.36KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-2.jpg[2] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.25KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-3.jpg[3] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.22KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-4.jpg[4] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.22KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-5.jpg[5] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.28KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-6.jpg[6] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.38KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-7.jpg[7] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.41KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-8.jpg[8] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.38KB 0.010u 0:00.010
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-9.jpg[9] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.28KB 0.010u 0:00.019
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-10.jpg[10] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.22KB 0.010u 0:00.019
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-11.jpg[11] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.22KB 0.020u 0:00.019
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-12.jpg[12] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.25KB 0.020u 0:00.019
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-13.jpg[13] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.36KB 0.020u 0:00.019
Images/made_with_mac.gif=>/tmp/analyze_images/Images/made_with_mac-14.jpg[14] GIF 88x31 88x31+0+0 8-bit sRGB 256c 2.4KB 0.020u 0:00.019
Informacje o pliku dla made_with_mac.gif
:
me@ubuntu:~/testdir$ file Images/made_with_mac.gif
Images/made_with_mac.gif: GIF image data, version 89a, 88 x 31
Lista katalogów dla Images/made_with_mac.gif
:
me@ubuntu:~/testdir$ ls -ls Images/made_with_mac.gif
12 -rw-rw-r-- 1 me me 11372 Dec 29 18:53 Images/made_with_mac.gif
Liczenie korzystania sum
z /tmp/analyze_images/Images/
:
me@ubuntu:~/testdir$ sum /tmp/analyze_images/Images/* | sort
11875 3 /tmp/analyze_images/Images/made_with_mac-13.jpg
11875 3 /tmp/analyze_images/Images/made_with_mac-1.jpg
21853 3 /tmp/analyze_images/Images/made_with_mac-6.jpg
21853 3 /tmp/analyze_images/Images/made_with_mac-8.jpg
28311 3 /tmp/analyze_images/Images/made_with_mac-12.jpg
28311 3 /tmp/analyze_images/Images/made_with_mac-2.jpg
34223 3 /tmp/analyze_images/Images/made_with_mac-0.jpg
41967 3 /tmp/analyze_images/Images/made_with_mac-14.jpg
47849 3 /tmp/analyze_images/Images/made_with_mac-5.jpg
47849 3 /tmp/analyze_images/Images/made_with_mac-9.jpg
48702 3 /tmp/analyze_images/Images/made_with_mac-11.jpg
48702 3 /tmp/analyze_images/Images/made_with_mac-3.jpg
49836 3 /tmp/analyze_images/Images/made_with_mac-10.jpg
49836 3 /tmp/analyze_images/Images/made_with_mac-4.jpg
65520 3 /tmp/analyze_images/Images/made_with_mac-7.jpg
Lista katalogów dla /tmp/analyze_images/Images/
:
me@ubuntu:~/testdir$ ls -ls /tmp/analyze_images/Images/*
4 -rw-rw-r-- 1 me me 2439 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-0.jpg
4 -rw-rw-r-- 1 me me 2219 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-10.jpg
4 -rw-rw-r-- 1 me me 2222 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-11.jpg
4 -rw-rw-r-- 1 me me 2249 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-12.jpg
4 -rw-rw-r-- 1 me me 2360 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-13.jpg
4 -rw-rw-r-- 1 me me 2404 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-14.jpg
4 -rw-rw-r-- 1 me me 2360 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-1.jpg
4 -rw-rw-r-- 1 me me 2249 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-2.jpg
4 -rw-rw-r-- 1 me me 2222 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-3.jpg
4 -rw-rw-r-- 1 me me 2219 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-4.jpg
4 -rw-rw-r-- 1 me me 2281 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-5.jpg
4 -rw-rw-r-- 1 me me 2384 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-6.jpg
4 -rw-rw-r-- 1 me me 2412 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-7.jpg
4 -rw-rw-r-- 1 me me 2384 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-8.jpg
4 -rw-rw-r-- 1 me me 2281 Jan 10 11:36 /tmp/analyze_images/Images/made_with_mac-9.jpg
źródło
identify
poleceniu, a także o tej dyskusji tutaj na oficjalnej stronie ImageMagick .