Ben $ genişlik ayarlı ise, onu görüntüyü yeniden boyutlandırmak ve daha sonra çıktısı, görüntü içeriğini okumak ve çıkış için bir sınıf var.
Ben bu $ image-> readImage (. '123 Jpg ') gibi işlevini çağırırsanız; , Bu çıkışı doğru görüntü dosyası olabilir, ama ben ('123 jpg ', 300). $ Image-> readImage çağırdığınızda; yeniden boyutlandırmak için, sadece boyutlandýrýlmýþ genişliği ve siyah bir resim görüntülemek yükseklik.
Ve ben gelen kodunu değiştirmek için çalıştı
@imagejpeg($thumb, null, 100);
karşı
@imagejpeg($image, null, 100);
irade ~ çalışıyor
-
protected function readImage($fileName, $width = 0) 
{
    if ($width <= 0) {
        return @file_get_contents($this->destination . '/' . $fileName);
    } else {
        $imageSize = @getimagesize($this->destination . '/' . $fileName);
        $actualWidth = $imageSize[0];
        $actualHeigth = $imageSize[1];
        if ($actualWidth <= $width) {
            return @file_get_contents($this->destination . '/' . $fileName);
        }
        $height = (100 / ($actualWidth / $width)) * .01;
        $height = @round($actualHeigth * $height);
        $image = @imagecreatefromjpeg($this->destination . '/' . $fileName);
        $thumb = @imagecreatetruecolor($width, $height);
        @imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $height, $actualWidth, $actualHeight);
        ob_start();
        @imagejpeg($thumb, null, 100);
        $bits = ob_get_contents();
        ob_end_clean();
        return $bits;
    }
}
Any experts know what happened and help me karşı solve it ?
Teşekkürler.
 
			