Permalink
Browse files

...

  • Loading branch information...
1 parent a453d1f commit c4d54257f57a7ec2a97822644ba452995fd95529 @tierra committed Oct 25, 2012
@@ -4002,6 +4002,12 @@ borger color while dragging a file over the uploader drop area */
.imgedit-wrap {
position: relative;
+ background-color: #fff;
+ background-image: -webkit-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(-45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(45deg, transparent 75%, #ccc 75%),
+ -webkit-linear-gradient(-45deg, transparent 75%, #ccc 75%);
+ background-size: 25px 25px;
}
.imgedit-settings p {
@@ -4071,6 +4077,12 @@ td.imgedit-settings input {
.wp_attachment_image, .A1B1 {
overflow: hidden;
+ background-color: #fff;
+ background-image: -webkit-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(-45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(45deg, transparent 75%, #ccc 75%),
+ -webkit-linear-gradient(-45deg, transparent 75%, #ccc 75%);
+ background-size: 25px 25px;
}
.wp_attachment_image .button, .A1B1 .button {
@@ -490,6 +490,11 @@ a:hover {
padding: 0 24px;
padding: 0 1.714285714rem;
background-color: #fff;
+ background-image: -webkit-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(-45deg, #ccc 25%, transparent 25%, transparent),
+ -webkit-linear-gradient(45deg, transparent 75%, #ccc 75%),
+ -webkit-linear-gradient(-45deg, transparent 75%, #ccc 75%);
+ background-size: 25px 25px;
}
.site-content {
margin: 24px 0 0;
@@ -146,7 +146,7 @@ protected function _resize( $max_w, $max_h, $crop = false ) {
return $resized;
}
- return WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
+ return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
}
/**
@@ -222,7 +222,7 @@ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = nu
return true;
}
- return WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
+ return new WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
}
/**
@@ -237,7 +237,9 @@ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = nu
*/
public function rotate( $angle ) {
if ( function_exists('imagerotate') ) {
- $rotated = imagerotate( $this->image, $angle, 0 );
+ $transparent_index = imagecolortransparent( $this->image );
+ $rotated = imagerotate( $this->image, $angle, $transparent_index );
+ imagecolortransparent( $this->image, $transparent_index );
if ( is_resource( $rotated ) ) {
imagedestroy( $this->image );
@@ -246,7 +248,7 @@ public function rotate( $angle ) {
return true;
}
}
- return WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
+ return new WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
}
/**
@@ -267,13 +269,13 @@ public function flip( $horz, $vert ) {
$sw = $vert ? -$w : $w;
$sh = $horz ? -$h : $h;
- if ( imagecopy( $dst, $this->image, 0, 0, $sx, $sy, $sw, $sh ) ) {
+ if ( imagecopymerge( $dst, $this->image, 0, 0, $sx, $sy, $sw, $sh, 50 ) ) {
imagedestroy( $this->image );
$this->image = $dst;
return true;
}
}
- return WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
+ return new WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
}
/**
@@ -59,7 +59,7 @@ protected function __construct( $filename ) {
private final static function choose_implementation() {
if ( null === self::$implementation ) {
- $request_order = apply_filters( 'wp_editors', array( 'imagick', 'gd' ) );
+ $request_order = apply_filters( 'wp_editors', array( /*'imagick',*/ 'gd' ) );
// Loop over each editor on each request looking for one which will serve this request's needs
foreach ( $request_order as $editor ) {
View
@@ -956,16 +956,19 @@ function wp_imagecreatetruecolor( $width, $height, $image_type = null, $original
// Use the same palette of colors as the original image. This also
// needs to be done for the transparent index to be valid in the
// new image.
- imagepalettecopy( $img, $original_image );
- $transparent_index = imagecolortransparent( $original_image );
- if ( $transparent_index >= 0 )
+ //imagepalettecopy( $img, $original_image );
+ $original_transparent_index = imagecolortransparent( $original_image );
+ if ( $original_transparent_index >= 0 )
{
+ $transparent_color = imagecolorsforindex( $original_image, $original_transparent_index );
+ $transparent_index = imagecolorallocate( $img, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );
imagefill( $img, 0, 0, $transparent_index );
imagecolortransparent( $img, $transparent_index );
+ //imagetruecolortopalette( $img, false, 255 );
}
} elseif ( 'image/png' === $image_type && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
- if ( function_exists( 'imagecolortransparent' ) && function_exists( 'imagecolorallocatealpha' ) )
- imagecolortransparent( $img, imagecolorallocatealpha( $img, 0, 0, 0, 127 ) );
+ //if ( function_exists( 'imagecolortransparent' ) )
+ // imagecolortransparent( $img, imagecolortransparent( $original_image ) );
imagealphablending( $img, false );
imagesavealpha( $img, true );
}

0 comments on commit c4d5425

Please sign in to comment.