简体   繁体   English

在Magento管理产品图片上传器中允许tiff / tiff图片文件

[英]Allowing tiff/tiff image files in Magento admin product image uploader

How do I allow tif/tiff files in the product image gallery uploader in Magento admin? 如何在Magento管理员的产品图片库上传器中允许tif / tiff文件? I've already tried updating {Package}_Adminhtml_Block_Media_Uploader::__construct() with the following code: 我已经尝试使用以下代码更新{Package} _Adminhtml_Block_Media_Uploader :: __ construct():

$this->getConfig()->setFilters(array(
        'images' => array(
            'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png, .tif)'),
            'files' => array('*.gif', '*.jpg', '*.png', '*.tif', '*.tiff')
        ),

Though the uploader browse popup still filters/grays out tif's. 尽管上载器浏览器弹出窗口仍会过滤/显示tif。

I've confirmed my local class is correctly overriding core. 我已经确认我的本地课程正确覆盖了核心。 I also located xml config for file extensions in the CMS module, but that obiviously is not related here (right?). 我还在CMS模块中找到了用于文件扩展名的xml config,但是显然与这里无关(对吗?)。

You are talking the image uploader within the WYSIWYG, correct? 您在说所见即所得中的图片上传器,对吗? Prattski explains how with a simple module here: http://prattski.com/2011/01/10/magento-allow-other-file-types-in-wysiwyg-editor/ Prattski在这里使用简单的模块进行了说明: http ://prattski.com/2011/01/10/magento-allow-other-file-types-in-wysiwyg-editor/

The problem with tiff is, that GD2 is not able to do anything with this format. tiff的问题在于,GD2无法使用此格式执行任何操作。 Therefore you need to change the Image_Adapter, eg to this: 因此,您需要将Image_Adapter更改为例如:

https://github.com/magento-hackathon/Perfect_Watermarks https://github.com/magento-hackathon/Perfect_Watermarks

and afterwards you have to rewrite the uploder (maybe a observer can do this too) to change the format check and add tif, tiff 然后,您必须重写上报器(也许观察者也可以这样做)以更改格式检查并添加tif,tiff

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM