Changeset 6031 in subversion
- Timestamp:
- Mar 24, 2012 1:57:31 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_image.php
r6022 r6031 41 41 public function props() 42 42 { 43 $rcmail = rcmail::get_instance(); 44 43 // use GD extension 45 44 if (function_exists('getimagesize') && ($imsize = @getimagesize($this->image_file))) { 46 45 $width = $imsize[0]; … … 50 49 } 51 50 52 if (!$type && ($cmd = $rcmail->config->get('im_identify_path', false))) { 53 $id = rcmail::exec($cmd. ' 2>/dev/null {in}', array('in' => $this->image_file)); 54 list(, $type, $size) = explode(' ', strtolower($id)); 55 if ($size) { 56 list($width, $height) = explode('x', $size); 57 } 51 // use ImageMagick 52 if (!$type && ($data = $this->identify())) { 53 list($type, $width, $height) = $data; 58 54 } 59 55 … … 67 63 } 68 64 } 69 70 65 71 66 /** … … 82 77 $rcmail = rcmail::get_instance(); 83 78 $convert = $rcmail->config->get('im_convert_path', false); 84 $identify = $rcmail->config->get('im_identify_path', false);85 79 $props = $this->props(); 86 80 … … 94 88 $p['in'] = $this->image_file; 95 89 $p['size'] = $size.'x'.$size; 96 $ p['type'] = $type= $props['type'];90 $type = $props['type']; 97 91 98 if (!$type ) {99 list(, $p['type']) = explode(' ', strtolower(rcmail::exec($identify . ' 2>/dev/null {in}', $p))); // for things like eps92 if (!$type && ($data = $this->identify())) { 93 $type = $data[0]; 100 94 } 101 95 … … 163 157 } 164 158 159 /** 160 * Identify command handler. 161 */ 162 private function identify() 163 { 164 $rcmail = rcmail::get_instance(); 165 166 if ($cmd = $rcmail->config->get('im_identify_path')) { 167 $args = array('in' => $this->image_file, 'format' => "%m %[fx:w] %[fx:h]"); 168 $id = rcmail::exec($cmd. ' 2>/dev/null -format {format} {in}', $args); 169 170 if ($id) { 171 return explode(' ', strtolower($id)); 172 } 173 } 174 } 165 175 }
Note: See TracChangeset
for help on using the changeset viewer.
