We help IT Professionals succeed at work.
Get Started

Search Inside Array (Array From Imagemagick identify verbose)

Pedro Chagas
Pedro Chagas asked
on
610 Views
Last Modified: 2012-05-06
Hi, I use identify of image magick for get some informations of one image, like you see in code box.....
The result is:
=========================================
Array
(
    [0] => Image: 5photos.jpg
    [1] =>   Format: JPEG (Joint Photographic Experts Group JFIF format)
    [2] =>   Class: DirectClass
    [3] =>   Geometry: 473x335+0+0
    [4] =>   Resolution: 100x100
    [5] =>   Print size: 4.73x3.35
    [6] =>   Units: PixelsPerInch
    [7] =>   Type: TrueColor
    [8] =>   Endianess: Undefined
    [9] =>   Colorspace: RGB
    [10] =>   Depth: 8-bit
    [11] =>   Channel depth:
    [12] =>     red: 8-bit
    [13] =>     green: 8-bit
    [14] =>     blue: 8-bit
    [15] =>   Channel statistics:
    [16] =>     red:
    [17] =>       min: 0 (0)
    [18] =>       max: 255 (1)
    [19] =>       mean: 117.824 (0.462055)
    [20] =>       standard deviation: 60.0605 (0.235531)
    [21] =>     green:
    [22] =>       min: 0 (0)
    [23] =>       max: 255 (1)
    [24] =>       mean: 120.322 (0.471852)
    [25] =>       standard deviation: 60.9865 (0.239163)
    [26] =>     blue:
    [27] =>       min: 0 (0)
    [28] =>       max: 255 (1)
    [29] =>       mean: 80.0232 (0.313817)
    [30] =>       standard deviation: 69.9419 (0.274282)
    [31] =>   Rendering intent: Undefined
    [32] =>   Interlace: None
    [33] =>   Background color: white
    [34] =>   Border color: rgb(223,223,223)
    [35] =>   Matte color: grey74
    [36] =>   Transparent color: black
    [37] =>   Page geometry: 473x335+0+0
    [38] =>   Dispose: Undefined
    [39] =>   Iterations: 0
    [40] =>   Compression: JPEG
    [41] =>   Quality: 38
    [42] =>   Orientation: Undefined
    [43] =>   Properties:
    [44] =>     comment: LEAD Technologies Inc. V1.01
    [45] =>     create-date: 2009-01-25T00:26:29+00:00
    [46] =>     jpeg:colorspace: 2
    [47] =>     jpeg:sampling-factor: 1x1,1x1,1x1
    [48] =>     modify-date: 2009-01-25T00:26:29+00:00
    [49] =>     signature: 204ae33f228d443047c10924a09de9298c4138b8f0b4eb4bfedf18846ca20276
    [50] =>   Artifacts:
    [51] =>     verbose: true
    [52] =>   Tainted: False
    [53] =>   Filesize: 22.209kb
    [54] =>   Number pixels: 154.74kb
    [55] =>   Version: ImageMagick 6.4.1 06/02/08 Q16 OpenMP http://www.imagemagick.org
)
==============================================
I want identify the 'quality' of each image, but the results not is allways the same, in this case quality appear in [41], and other images appear in [393] and so on.
So, if I cant identify the quality of each photo, I cant do a dinamic script.

For this problem, I thing is possible with search inside the array.
I want search where is the position of 'quality' of each image.

The best regars,
JC
exec("/usr/bin/identify -verbose 5photos.jpg", $varrr);
echo '<pre>';
print_r($varrr);
echo '</pre>';

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Expert of the Year 2008
Top Expert 2008
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE