私はMagentoバージョン1.9.3.3を使用しており、数少ないpngの画像を使用しています。自動的に黒い背景が追加されます。透明性を保つために私を助けてください。MagentoはPNG画像に黒い背景を追加します
0
A
答えて
0
これは、Magentoの1.9.3.3またはパッチSUPEE 9767
を適用した後に頻繁に発生するようです。 これをお読みくださいWatermark get black background when transparent
0
同じ問題がありましたが、以前のlib/Varien/Image/Adaptor/Gd2.phpをパッチの前にアップロードしてもう一度作業しました。
0
Magentoバージョン1.9.3.3で同じ問題が発生しました。修正の下で私の問題を解決してください
このクラスファイルを延長しますMage_Core_Model_File_Validator_Image
。
作成モジュール:以下の内容でMagegeeks_Core_Model_File_Validator_Image
で
クレタファイル:など/ config.xmlファイルで
class Magegeeks_Core_Model_File_Validator_Image extends Mage_Core_Model_File_Validator_Image
{
/**
* Validation callback for checking is file is image
*
* @param string $filePath Path to temporary uploaded file
* @return null
* @throws Mage_Core_Exception
*/
public function validate($filePath)
{
list($imageWidth, $imageHeight, $fileType) = getimagesize($filePath);
if ($fileType) {
if ($this->isImageType($fileType)) {
//replace tmp image with re-sampled copy to exclude images with malicious data
$image = imagecreatefromstring(file_get_contents($filePath));
if ($image !== false) {
$img = imagecreatetruecolor($imageWidth, $imageHeight);
imagealphablending($img, false);
imagecopyresampled($img, $image, 0, 0, 0, 0, $imageWidth, $imageHeight, $imageWidth, $imageHeight);
imagesavealpha($img, true);
switch ($fileType) {
case IMAGETYPE_GIF:
imagegif($img, $filePath);
break;
case IMAGETYPE_JPEG:
imagejpeg($img, $filePath, 100);
break;
case IMAGETYPE_PNG:
imagepng($img, $filePath);
break;
default:
return;
}
imagedestroy($img);
imagedestroy($image);
return null;
} else {
throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid image.'));
}
}
}
throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid MIME type.'));
}
:
<config>
<modules>
<Magegeeks_Core>
<version>0.0.1</version>
</Magegeeks_Core>
</modules>
<global>
<models>
<sdm_core>
<class>Magegeeks_Core_Model</class>
</sdm_core>
<core>
<rewrite>
<file_validator_image>SDM_Core_Model_File_Validator_Image</file_validator_image>
</rewrite>
</core>
</models>
</global>
</config>
アプリの/ etc/modules/Magegeeks_Core.xml
<config>
<modules>
<Magegeeks_Core>
<active>true</active>
<codePool>local</codePool>
</Magegeeks_Core>
</modules>
</config>
・ホープこれはあなたの問題を解決します。
関連する問題
- 1. アップロード/リサイズ時に黒い背景を表示するPNG画像
- 2. 背景画像ではない画像に黒いオーバーレイを追加するwordpressはプラグインを投稿します
- 3. PHP&JS - Jcrop - 選択したPNG画像に黒い背景があります
- 4. PNGの黒い背景にキャンバスをダウンロード
- 5. Magento画像の背景から黒の画像を取り除く方法
- 6. パンした画像の背景に黒い背景があります。 Swift 3
- 7. 透明な背景を持つpng画像が黒い背景で表示されます
- 8. SVGに背景画像を追加
- 9. UITableViewプログラミングに背景画像を追加
- 10. AndroidスタジオはPNG画像に白い背景を追加します。それを修正するには?
- 11. .pngナビゲーションバーの背景画像として
- 12. CantはCSSボタンに背景画像を追加します
- 13. JAVA - PNG画像をアップロードするときに背景が黒くなる
- 14. 画像に黒い背景を与えますか?
- 15. CSSで背景画像を追加
- 16. は、背景画像を追加するナビゲーションバーの右側に暗い影を示す背景画像
- 17. パイゲームに背景画像を追加しますか?
- 18. WindowsフォームTreeView - PNG画像の背景
- 19. ブロックの背景として画像を追加するには
- 20. php imagecopyresampledは黒の背景を追加します
- 21. シェイプエディタ - ステレオタイプ - png形式 - 黒色の背景
- 22. 透明な背景のpng画像の問題は、タイプPNGの
- 23. 画像の背景を削除して背景なしで追加する
- 24. Graphics.DrawImageを使用して、透明なPNG画像の背景を黒に変更します。
- 25. GoJS:図に背景画像を追加するには
- 26. Shopifyのnavの背景に画像を追加するには
- 27. CSSとHTMLに背景画像を追加するには
- 28. Androidでペイントクラスに背景画像を追加するには?
- 29. ブートストラップ画像に背景を追加するには?
- 30. Linuxバッチ(gimp、imagemagick)は、一連の透明なPNGに背景画像を追加します