Slide 1

Slide 1 text

WordCamp Europe 2013 The Netherlands P rf Y r I U W r Pr Mike Schroder & Marko Heijnen

Slide 2

Slide 2 text

WordCamp Europe 2013 The Netherlands M M r DH-Shredder @GetSource Recent rockstar 3.5 WP-CLI contributor WordPress Core rep Happy DreamHost Employee @MarkoHeijnen Recent rockstar 3.4 GlotPress lead developer Founder of CodeKitchen

Slide 3

Slide 3 text

WordCamp Europe 2013 The Netherlands W w wrong?

Slide 4

Slide 4 text

WordCamp Europe 2013 The Netherlands GD w directly

Slide 5

Slide 5 text

WordCamp Europe 2013 The Netherlands I abstracted

Slide 6

Slide 6 text

WordCamp Europe 2013 The Netherlands WP_I _E r • Centralized way to read an image file • manipulate it • save IT • STREAM IT

Slide 7

Slide 7 text

WordCamp Europe 2013 The Netherlands H w w MADE?

Slide 8

Slide 8 text

WordCamp Europe 2013 The Netherlands I r COOPERATION.

Slide 9

Slide 9 text

WordCamp Europe 2013 The Netherlands G v w r f core

Slide 10

Slide 10 text

WordCamp Europe 2013 The Netherlands GD Imagick S r

Slide 11

Slide 11 text

WordCamp Europe 2013 The Netherlands Imagick color profiles

Slide 12

Slide 12 text

WordCamp Europe 2013 The Netherlands Difference GD Imagick

Slide 13

Slide 13 text

WordCamp Europe 2013 The Netherlands W ’ catch?

Slide 14

Slide 14 text

WordCamp Europe 2013 The Netherlands N r direct

Slide 15

Slide 15 text

WordCamp Europe 2013 The Netherlands D r r • Image_save_pre is now image_editor_save_pre • wp_save_image_file is now wp_save_image_editor_file • image_edit_before_change is now wp_image_editor_before_change

Slide 16

Slide 16 text

WordCamp Europe 2013 The Netherlands W ’ ? Centralized way to read an image attachment from the database and manage its sizes and properties

Slide 17

Slide 17 text

WordCamp Europe 2013 The Netherlands M b WP_I ... https://github.com/markoheijnen/WP_Image

Slide 18

Slide 18 text

WordCamp Europe 2013 The Netherlands T No current alternative to load_image_to_edit(), so: wp_get_image_editor( _load_image_to_edit_path( $post_id ) );

Slide 19

Slide 19 text

WordCamp Europe 2013 The Netherlands O , w can w w ?

Slide 20

Slide 20 text

WordCamp Europe 2013 The Netherlands • resize( $max_w, $max_h, $crop ); • multi_resize( { ['size'] => {'width', 'height',['crop']}, ... } ); • crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs ); • rotate( $angle ); • flip( $horz, $vert ); • save( $destfilename, $mime_type ); • stream( $mime_type );

Slide 21

Slide 21 text

WordCamp Europe 2013 The Netherlands

Slide 22

Slide 22 text

WordCamp Europe 2013 The Netherlands A r // Get instance of WP_Image_Editor selected by WordPress $editor = wp_get_image_editor( '/path/to/image.png' ); // Returns WP_Error on failure, so check. if ( ! is_wp_error( $editor ) ) { // Resize the image with a center crop $editor->resize( 300, 300, true ); // Uses extension for type, unless optional mime parameter is used. $editor->save( 'new_image.gif' ); }

Slide 23

Slide 23 text

WordCamp Europe 2013 The Netherlands A r ©Massimo Catarinella (CC-SA)

Slide 24

Slide 24 text

WordCamp Europe 2013 The Netherlands A r

Slide 25

Slide 25 text

WordCamp Europe 2013 The Netherlands Extend r r w - engines r functions.

Slide 26

Slide 26 text

WordCamp Europe 2013 The Netherlands Tiff: I r ?

Slide 27

Slide 27 text

WordCamp Europe 2013 The Netherlands Y v Imagick f r v r ’ f v r r:

Slide 28

Slide 28 text

WordCamp Europe 2013 The Netherlands Sepia!

Slide 29

Slide 29 text

WordCamp Europe 2013 The Netherlands

Slide 30

Slide 30 text

WordCamp Europe 2013 The Netherlands

Slide 31

Slide 31 text

WordCamp Europe 2013 The Netherlands f r ! A q ? @getSource & @markoHeijnen

Slide 32

Slide 32 text

WordCamp Europe 2013 The Netherlands • GD: wp-includes/class-wp-image-editor-gd.php • Imagick: wp-includes/class-wp-image-editor-imagick.php • Gmagick: http://wordpress.org/extend/plugins/gmagick/ • Improved GD Editor: http://wordpress.org/plugins/improved-gd-image-editor/ E r

Slide 33

Slide 33 text

WordCamp Europe 2013 The Netherlands • http://make.wordpress.org/core/2012/12/06/wp_image_editor-is- incoming/ • http://markoheijnen.com/wordpress-new-image-manipulation/ • http://xref.wordpress.org/trunk/WordPress/Image_Editor/ WP_Image_Editor.html M r R r !

Slide 34

Slide 34 text

WordCamp Europe 2013 The Netherlands • https://github.com/getsource/imagick-sepia/ • https://github.com/humanmade/WPThumb/ • https://github.com/markoheijnen/gmagick-editor • https://github.com/markoheijnen/Improved-image-editor • https://github.com/interconnectit/my-eyes-are-up-here M r R r !