Altering the content of an array in PHP -
i have php script in code fetches exif data photo variable follows:
$exif_data = get_exif_jpeg( $filename ); note: function 'get_exif_jpeg( $filename )' called 'included' script.
i printed content of variable find out how exif information held in variable using:
var_dump ($exif_data); for interested in seeing full contents of variable, can seen using link - http://uko.com/testexif2/phptest.php
within results there section contains size of photo recorded camera. content of section is:
[40962]=> array(9) { ["tag number"]=> int(40962) ["tag name"]=> string(17) "pixel x dimension" ["tag description"]=> string(0) "" ["data type"]=> int(4) ["type"]=> string(7) "numeric" ["units"]=> string(6) "pixels" ["data"]=> array(1) { [0]=> int(4000) } ["text value"]=> string(11) "4000 pixels" ["decoded"]=> bool(true) } i want change content of alter recorded image size , found info resulted in me trying code ($new_width specified @ beginning of script):
$exif_data[40962]['data'][0] = $new_width; $exif_data[40962]['text value'] = $new_width . ' pixels'; this not right not alter existing data, adds information end of data held in variable.
can tell me necessary code should - or point me in direction of may information help.
you missed 1 level
$exif_data[0][40962]['data'][0] = $new_width; $exif_data[0][40962]['text value'] = $new_width . ' pixels';
Comments
Post a Comment