(29.07.2013, 00:18)Flinx schrieb: Warning: imagepng(): gd-png error: compression level must be 0 through 9 in
Warning: imagecreatefrompng(): xxx is not a valid PNG file in
Warning: imagecopymerge() expects parameter 1 to be resource, boolean given in
Warning: imagepng() expects parameter 1 to be resource, boolean given in
Warning: Creating default object from empty value in
Wenn mir jemand das hier erklären kann, dann helfe ich gerne.
der erste fehler hat etwas mit der qualität des bildes zu tun:
Last argument in imagepng($image_p, null, 100) should be between 0 and 9.
In the case of uploading a PNG with 'thumbnailMethod' => 'php', then the thumbnailQuality MUST be between 0-9; and 0 represents the highest quality, not the lowest. So, I set it to 0, which works fine for PNGs. But then you try to upload a JPG for that field, and the 0 setting means you have a horrible, zero-quality JPG. So the same value is used in non-compatible contexts.
In terms of solutions, the obvious ones would be:
a) in the case where it has to be 0-9, convert the provided 0-100 value of thumbnailQuality to a corresponding 0-9 value (eg, 100 would become 0, 40 would become 5, 0 would become 9, etc)
der zweite fehler könnte mit etwas glück dann dadurch auch behoben werden, da er halt kein bild im PNG-Format findet. der letzte fehler dann auch