$image_width) { $height = "8cm"; } else { $width = "100%"; } $contents = file_get_contents($path); return compact("width", "height", "contents"); } }