Код: Выделить всё
public function printSummaryArticle($article, $copy) {
// create a thumbnail for the image as per the row data if one does not exist
if (!file_exists('/images/articles/thumbs/th_' . $article['image'])) {
$image_handle = imagecreatefromjpeg(Config::getAbsPath() . '/images/articles/' . $article['image']);
// WideImage plugin
WideImage::load($image_handle)->resize(300, 200)->saveToFile(Config::getAbsPath() . '/images/articles/thumbs/th_' . $article['image']);
}
// echo the thumbnail just created
echo
'
[img]/images/articles/thumbs/th_[/img]
. $article['image']
. '">';
}
Код: Выделить всё
Warning: imagejpeg(/images/articles/thumbs/th_037.jpg): failed to open stream: No such file or directory in /home2/obmonco1/public_html/gulfinsight/lib/omc_frmwrk/plugins/WideImage/Mapper/JPEG.php on line 39
Fatal error: Uncaught exception 'WideImage_UnknownErrorWhileMappingException' with message 'WideImage_Mapper_JPEG returned an invalid result while saving to /images/articles/thumbs/th_037.jpg' in /home2/obmonco1/public_html/gulfinsight/lib/omc_frmwrk/plugins/WideImage/Image.php:164 Stack trace: #0 /home2/obmonco1/public_html/gulfinsight/lib/omc_frmwrk/bespoke/DisplayEngine.php(181): WideImage_Image->saveToFile('/images/article...') #1 /home2/obmonco1/public_html/gulfinsight/lib/omc_frmwrk/bespoke/PageTemplate.php(70): DisplayEngine->printSummaryArticle(Array, Object(GetCopy)) #2 /home2/obmonco1/public_html/gulfinsight/index.php(100): PageTemplate->homePage() #3 {main} thrown in /home2/obmonco1/public_html/gulfinsight/lib/omc_frmwrk/plugins/WideImage/Image.php on line 164
Я также пытался получить доступ к изображению напрямую вместо того, чтобы сначала создавать обработчик изображения, как вы видите выше.
Когда я пытаюсь вывести изображение напрямую, используя метод вывода:
Код: Выделить всё
public function printSummaryArticle($article, $copy) {
// create a thumbnail for the image as per the row data if one does not exist
if (!file_exists('/images/articles/thumbs/th_' . $article['image'])) {
$image_handle = imagecreatefromjpeg(Config::getAbsPath() . '/images/articles/' . $article['image']);
// WideImage plugin
WideImage::load($image_handle)->resize(300, 200)->output('jpeg');
}
// echo the thumbnail just created
echo
'
[img]/images/articles/thumbs/th_[/img]
. $article['image']
. '">';
}
Код: Выделить всё
Warning: Cannot modify header information - headers already sent by (output started at D:\Open Media Collective\Projects\Gulf Insight\web\publish\lib\omc_frmwrk\bespoke\DisplayEngine.php:130) in D:\Open Media Collective\Projects\Gulf Insight\web\publish\lib\omc_frmwrk\plugins\WideImage\Image.php on line 198
Я открыл и проверил каждый файл php, мне нужно искать пробелы до и после открывающих-закрывающих php-тегов... и я бы предпочел не использовать выходной буфер.
РЕДАКТИРОВАТЬ: забыл Упомяните, я установил разрешения 777 для изображений, статей и превью. папки. Та же ошибка.
ТРЕБУЕТСЯ ДОПОЛНЕНИЕ:
"WideImage/Mapper/JPEG.php в строке 39"
Код: Выделить всё
return imagejpeg($handle, $uri, $quality);
Подробнее здесь: https://stackoverflow.com/questions/142 ... to-headers