﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
23039	WP_Image_Editor_GD does not preserve alpha if is not resized	joehoyle		"If I do something like:


{{{
$wp_image_editor_gd->load( $file ) /* $file is a transparent 5px x 5px image) */
$wp_image_editor_gd->resize( 5, 5 ); /* or don't even call resize at all */
$wp_image_editor_gd->save( $new_filepath );
}}}

Then the saved file will be stripped of its transparency. This is because for image alpha to be preserved, the GD resource has to be passed to `wp_imagecreatetruecolor` and it is only passed to that is the resize is smaller is not equal to the original dimensions. The same goes for crop() etc.

It's best to see this here: http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-image-editor-gd.php#L137 , the alpha only preserved it it hits http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-image-editor-gd.php#L161

If this is not a known issue I can write a patch and unit tests for it."	defect (bug)	closed	normal	3.6	Media	3.5	normal	fixed		
