@Bleistivt, thanks for the tip! I'll probably set the second argument to false for the $UploadImage->GenerateTargetName() call. Also, it looks like validating the extension against an array of allowed extensions isn't necessary as $UploadImage->ValidateUpload() throws an exception for uploads that aren't images.
Comments
Fixed it myself. Changed "jpg" in GenerateTargetName call and SaveImageAs call to "png".
Here's a more in-depth fix (detect image type). Beginning at line 446, through 476.
Will consider adding transparency support for image uploads in a future release. Thanks, @agcyphers!
Add Pages to Vanilla with the Basic Pages app
If you set the second parameter of GenerateTargetName to FALSE, it will figure out the extension by itself.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt, thanks for the tip! I'll probably set the second argument to false for the
$UploadImage->GenerateTargetName()
call. Also, it looks like validating the extension against an array of allowed extensions isn't necessary as$UploadImage->ValidateUpload()
throws an exception for uploads that aren't images.Add Pages to Vanilla with the Basic Pages app
The purpose of that validation was to have a default extension of jpg if no others were found. Probably not the best way to do it.