How can I upload a transparent PNG (and preserve this transparency) using Meioupload in CakePHP?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m having the same problem. This is what fixed it for me:
Around line 962 of MeioUploadBehaviour.php, there are 2 lines:
Change the second line to:
EXPLANATION: The original line is an attempt to set $phpThumb->config_output_format to the file extension of your uploaded image. It works, so long as there is only one ‘.’ in the file path of your uploaded image. Eg., if your path is /mywebsite/images/myImage.png, then it gets ‘png’.
But, if there’s a ‘.’ earlier in your $source, eg. /mywebsite.com/images/myImage.png then what you get returned is the middle part, from the first ‘.’ to the second ‘.’
So you’d get something like: ‘com/images/myImage’
Of course, ‘com/images/myImage’ isn’t a valid config_output_format for phpThumb!
By making the change from $imageArray[1] to end($imageArray), you always get the last element of the image array, which should always be the file extension.
Really, this enhancement should be made permenantly in MeioUpload. EDIT: I’ve forked MeioUpload and made the fix. I’ve sent a pull request to jrbasso, but so far it hasn’t been accepted. You can view my fork here: https://github.com/joshuapaling/MeioUpload