{"id":11402209,"date":"2019-04-08T05:46:07","date_gmt":"2019-04-08T05:46:07","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/image-watermark-cause-500-error-with-enable-media-replace-plugin\/"},"modified":"2019-04-08T05:46:07","modified_gmt":"2019-04-08T05:46:07","slug":"image-watermark-cause-500-error-with-enable-media-replace-plugin","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/image-watermark-cause-500-error-with-enable-media-replace-plugin\/","title":{"rendered":"Image Watermark cause 500 error with Enable Media Replace plugin"},"content":{"rendered":"<p>Hello!<\/p>\n<p>Thanks for the amazing plugin.<br \/>\nFor instance, I found a little problem in the following scenario.<\/p>\n<p>1 While <a href=\"https:\/\/wordpress.org\/plugins\/enable-media-replace\/\" rel=\"noopener noreferrer\" target=\"_blank\">Enable Media Replace(EMR)<\/a> is installed and activated, with option &#8220;Enable watermark for uploaded images.&#8221; enabled.<br \/>\n2 Both GD and Imagick was tried<br \/>\n3 When upload image through Enable Media Replace for an existing image, it will generate 500 error.<\/p>\n<p>Note<br \/>\nThe tested file is a normal RGB jpg with a depth of 8.<br \/>\nTested both local(php 7.3.1) and production environment(php 7.3.3).<\/p>\n<p>I am not sure what did trigger the 500 error.<br \/>\nAccording to the log file, when uploading the image through EMR with Image Watermark enabled, it will cause Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes), the memory for such image is more than enough in daily operation and it occurs only when GD is used in this case.<\/p>\n<p>If you have any debug advice, please feel free to let me know.<br \/>\nI am willing to help in testing out.<br \/>\nMany thanks.<\/p>\n","protected":false},"template":"","class_list":["post-11402209","topic","type-topic","status-publish","hentry","topic-tag-gd","topic-tag-imagick"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11402209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11402209\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11402209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}