PHP 8.3.10
Call to undefined method Intervention\Image\Image::response()
{
$imageUrl = Str::beforeLast($imageUrl, '.webp');
if(!File::exists(upload_path($folder.'/'.$imageUrl))) {
exit();
}
list($width, $height, $zoom_crop) = array_pad(explode('x', $thumbsize), 3, null);
$thumb_path = thumb_path() . '/' . $thumbsize . '/' . $path . '/' . $folder;
if (!File::exists($thumb_path . '/' . $imageUrl . '.webp')) {
$image = $this->getRead($thumb_path, $folder, $imageUrl, $width, $height, $zoom_crop, $path);
$image = $image->toWebp(100);
$image->save($thumb_path . '/' . $imageUrl . '.webp');
return $image->response();
} else {
$image = Image::read($thumb_path . '/' . $imageUrl . '.webp');
}
return $image->response();
}
public function watermark($thumbsize, $path, $folder, $imageUrl)
{
$imageUrl = Str::beforeLast($imageUrl, '.webp');
if(!File::exists(upload_path($folder.'/'.$imageUrl))) {
exit();
}
list($width, $height, $zoom_crop) = array_pad(explode('x', $thumbsize), 3, null);
$thumb_path = watermark_path() . '/' . $thumbsize . '/' . $path . '/' . $folder;
if (!File::exists($thumb_path . '/' . $imageUrl . '.webp')) {
$image = $this->getRead($thumb_path, $folder, $imageUrl, $width, $height, $zoom_crop);
$watermark = PhotoModel::where('type', 'watermark_product')->whereRaw("FIND_IN_SET(?,status)", ['hienthi'])->first();
if (!empty($watermark)) {
$options = (!empty($watermark['options'])) ? json_decode($watermark['options'], true) : ['position' => 'top-left', 'offset_x' => 0, 'offset_y' => 0, 'opacity' => 100];
Request
https://truongmaisaigon.vn/thumbs/360x235x1/upload/news/ban-ghe-van-phong-thuan-an-binh-duong-1-3108.jpg
GET
curl "https://truongmaisaigon.vn/thumbs/360x235x1/upload/news/ban-ghe-van-phong-thuan-an-binh-duong-1-3108.jpg" \
-X GET \
-H 'host: truongmaisaigon.vn' \
-H 'priority: u=0, i' \
-H 'accept-encoding: gzip, deflate, br, zstd' \
-H 'sec-fetch-dest: document' \
-H 'sec-fetch-user: ?1' \
-H 'sec-fetch-mode: navigate' \
-H 'sec-fetch-site: none' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
-H 'user-agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)' \
-H 'upgrade-insecure-requests: 1' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua: "HeadlessChrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache';
Browser
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Headers
- host
truongmaisaigon.vn
- priority
u=0, i
- accept-encoding
gzip, deflate, br, zstd
- sec-fetch-dest
document
- sec-fetch-user
?1
- sec-fetch-mode
navigate
- sec-fetch-site
none
- accept
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
- user-agent
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
- upgrade-insecure-requests
1
- sec-ch-ua-platform
"Windows"
- sec-ch-ua-mobile
?0
- sec-ch-ua
"HeadlessChrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"
- cache-control
no-cache
- pragma
no-cache