【问题标题】:Laravel 4 imagecache intervention not displaying imagesLaravel 4 imagecache干预不显示图像
【发布时间】:2015-06-08 18:31:02
【问题描述】:

这是带有图像缓存图像的产品页面:http://kmk-prof.kz/product/dx700lc

如您所见 - 图像未显示并具有以下 url:/imagecache/catalogue/dx700lc-541a82fe99ac3.jpg

但是当我尝试在我的上传文件夹中浏览该图像时 - http://kmk-prof.kz/uploads/dx700lc-541a82fe99ac3.jpg 它显示得很好。

为什么imagecache不能工作?

这是图像缓存配置.php:

'route' => 'imagecache',

'paths' => array(
    public_path('uploads'),
),

'templates' => array(
    'catalogue' => function($image) {
        return $image->fit(213, 213);
    },
),

【问题讨论】:

    标签: laravel laravel-4 image-caching intervention


    【解决方案1】:

    很难告诉您为什么没有任何代码就无法显示图像。 查看该站点,当您的文件位于 uploads/dx700lc-541a82fe99ac3.jpg 中时,您的图像(在 html 中)正在寻找 /imagecache/catalogue/dx700lc-541a82fe99ac3.jpg 中的文件。

    你可以做两件事:

    1. 更改代码以从uploads/dx700lc-541a82fe99ac3.jpg 加载文件。
    2. 或者,将您的图像路径更改为/imagecache/catalogue/dx700lc-541a82fe99ac3.jpg

    如果您需要更多帮助,请发布您的代码。

    PS。您的 IMAGE URL 链接无效^_^

    【讨论】:

    • 你好。如果我更改为您的第一种方法,那么它将直接从上传文件夹加载而无需任何图像操作(这就是我使用 imagecache 的原因)显然第二种方法不起作用,这就是我创建这个问题的原因。你需要代码做什么?它只是创建路由的 Intervention/Imagecache 包:{imagecache}/{presetname}/{filename}
    猜你喜欢
    • 1970-01-01
    • 2014-08-03
    • 2015-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-13
    • 2015-03-12
    相关资源
    最近更新 更多