OpenCart 1.5:如何禁用 SVG 缓存?
OpenCart 1.5: how to disable caching for SVG?
我想将 svg 用于品牌图片 - svg 响应迅速,适合高 DPI 的显示器。但是我对 Opencart 1.5 的缓存机制有问题,无法更正缓存矢量图像,并且在浏览器中我看不到图像。
我没有找到(在搜索中)任何解决方案或 Opencart 的任何扩展 - svg 也可以缩小,但这不是光栅。
我不是 Opencart 和 php 的专家,我想问你在这种情况下有更好的解决方案。
作为OpenCart2.0.x
系列的possible purpose for uploading SVG seems to not be planned,我想目前前1.5.x
系列没有解决方案.
您可以让图像调整功能略过 svg
文件扩展名 mod 的图像。签入 catalog/model/tool/image.php
行:
if ($width_orig != $width || $height_orig != $height) {
并包含一些逻辑以跳过扩展名为 "svg" 的文件:
if (strtolower($extension) != 'svg' && ($width_orig != $width || $height_orig != $height)) {
结果是原始文件的未mod化副本被放置在image/cache
目录中,而不是使用 GD 库处理。
我想将 svg 用于品牌图片 - svg 响应迅速,适合高 DPI 的显示器。但是我对 Opencart 1.5 的缓存机制有问题,无法更正缓存矢量图像,并且在浏览器中我看不到图像。
我没有找到(在搜索中)任何解决方案或 Opencart 的任何扩展 - svg 也可以缩小,但这不是光栅。
我不是 Opencart 和 php 的专家,我想问你在这种情况下有更好的解决方案。
作为OpenCart2.0.x
系列的possible purpose for uploading SVG seems to not be planned,我想目前前1.5.x
系列没有解决方案.
您可以让图像调整功能略过 svg
文件扩展名 mod 的图像。签入 catalog/model/tool/image.php
行:
if ($width_orig != $width || $height_orig != $height) {
并包含一些逻辑以跳过扩展名为 "svg" 的文件:
if (strtolower($extension) != 'svg' && ($width_orig != $width || $height_orig != $height)) {
结果是原始文件的未mod化副本被放置在image/cache
目录中,而不是使用 GD 库处理。