run:R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
23.8 KB
2026-03-11 16:18:51
R W Run
7.8 KB
2026-03-11 16:18:52
R W Run
36.1 KB
2026-03-11 16:18:51
R W Run
11.9 KB
2026-03-11 16:18:52
R W Run
18.94 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:52
R W Run
28.6 KB
2026-03-11 16:18:51
R W Run
316 By
2026-03-11 16:18:51
R W Run
12.9 KB
2026-03-11 16:18:51
R W Run
61.02 KB
2026-03-11 16:18:52
R W Run
15 KB
2026-03-11 16:18:51
R W Run
112.05 KB
2026-03-11 16:18:51
R W Run
12.47 KB
2026-03-11 16:18:51
R W Run
15.07 KB
2026-03-11 16:18:52
R W Run
9.84 KB
2026-03-11 16:18:52
R W Run
13.17 KB
2026-03-11 16:18:52
R W Run
33.83 KB
2026-03-11 16:18:51
R W Run
42.63 KB
2026-03-11 16:18:51
R W Run
55.71 KB
2026-03-11 16:18:52
R W Run
12.53 KB
2026-03-11 16:18:51
R W Run
2.55 KB
2026-03-11 16:18:52
R W Run
28.92 KB
2026-03-11 16:18:52
R W Run
539 By
2026-03-11 16:18:51
R W Run
367 By
2026-03-11 16:18:52
R W Run
42.65 KB
2026-03-11 16:18:51
R W Run
401 By
2026-03-11 16:18:51
R W Run
6.61 KB
2026-03-11 16:18:51
R W Run
664 By
2026-03-11 16:18:52
R W Run
20.63 KB
2026-03-11 16:18:51
R W Run
2.18 KB
2026-03-11 16:18:52
R W Run
453 By
2026-03-11 16:18:52
R W Run
457 By
2026-03-11 16:18:51
R W Run
36.83 KB
2026-03-11 16:18:52
R W Run
2.41 KB
2026-03-11 16:18:52
R W Run
8.28 KB
2026-03-11 16:18:51
R W Run
13.89 KB
2026-03-11 16:18:51
R W Run
11.76 KB
2026-03-11 16:18:51
R W Run
2.65 KB
2026-03-11 16:18:51
R W Run
7.43 KB
2026-03-11 16:18:51
R W Run
17.46 KB
2026-03-11 16:18:51
R W Run
5.14 KB
2026-03-11 16:18:52
R W Run
16.7 KB
2026-03-11 16:18:51
R W Run
8.28 KB
2026-03-11 16:18:52
R W Run
2.92 KB
2026-03-11 16:18:52
R W Run
1.32 KB
2026-03-11 16:18:51
R W Run
4.6 KB
2026-03-11 16:18:52
R W Run
11.62 KB
2026-03-11 16:18:52
R W Run
2.5 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
11.25 KB
2026-03-11 16:18:52
R W Run
5.32 KB
2026-03-11 16:18:51
R W Run
10.99 KB
2026-03-11 16:18:52
R W Run
68.32 KB
2026-03-11 16:18:51
R W Run
6.34 KB
2026-03-11 16:18:51
R W Run
5.49 KB
2026-03-11 16:18:51
R W Run
1.99 KB
2026-03-11 16:18:52
R W Run
7.02 KB
2026-03-11 16:18:51
R W Run
4.91 KB
2026-03-11 16:18:52
R W Run
16.86 KB
2026-03-11 16:18:51
R W Run
24.23 KB
2026-03-11 16:18:51
R W Run
3.97 KB
2026-03-11 16:18:51
R W Run
47.66 KB
2026-03-11 16:18:51
R W Run
9.22 KB
2026-03-11 16:18:51
R W Run
25.51 KB
2026-03-11 16:18:51
R W Run
198.38 KB
2026-03-11 16:18:52
R W Run
56.65 KB
2026-03-11 16:18:51
R W Run
10.46 KB
2026-03-11 16:18:51
R W Run
10.95 KB
2026-03-11 16:18:52
R W Run
29.26 KB
2026-03-11 16:18:51
R W Run
70.91 KB
2026-03-11 16:18:52
R W Run
35.3 KB
2026-03-11 16:18:52
R W Run
16.61 KB
2026-03-11 16:18:52
R W Run
2.57 KB
2026-03-11 16:18:52
R W Run
39.83 KB
2026-03-11 16:18:51
R W Run
70.64 KB
2026-03-11 16:18:51
R W Run
15.56 KB
2026-03-11 16:18:52
R W Run
7.33 KB
2026-03-11 16:18:52
R W Run
253 By
2026-03-11 16:18:51
R W Run
7.96 KB
2026-03-11 16:18:52
R W Run
3.23 KB
2026-03-11 16:18:52
R W Run
969 By
2026-03-11 16:18:52
R W Run
16.28 KB
2026-03-11 16:18:51
R W Run
7.22 KB
2026-03-11 16:18:51
R W Run
12.95 KB
2026-03-11 16:18:51
R W Run
6.53 KB
2026-03-11 16:18:51
R W Run
3.42 KB
2026-03-11 16:18:52
R W Run
5.84 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
4.3 KB
2026-03-11 16:18:52
R W Run
2.91 KB
2026-03-11 16:18:51
R W Run
16.46 KB
2026-03-11 16:18:52
R W Run
40.6 KB
2026-03-11 16:18:51
R W Run
20.22 KB
2026-03-11 16:18:51
R W Run
36.11 KB
2026-03-11 16:18:52
R W Run
17.01 KB
2026-03-11 16:18:51
R W Run
7.27 KB
2026-03-11 16:18:52
R W Run
6.62 KB
2026-03-11 16:18:52
R W Run
16.49 KB
2026-03-11 16:18:52
R W Run
1.79 KB
2026-03-11 16:18:52
R W Run
29.82 KB
2026-03-11 16:18:51
R W Run
6.67 KB
2026-03-11 16:18:52
R W Run
8.98 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:51
R W Run
12.01 KB
2026-03-11 16:18:51
R W Run
17.11 KB
2026-03-11 16:18:51
R W Run
6.74 KB
2026-03-11 16:18:52
R W Run
30.93 KB
2026-03-11 16:18:51
R W Run
4.99 KB
2026-03-11 16:18:51
R W Run
4.25 KB
2026-03-11 16:18:51
R W Run
24.72 KB
2026-03-11 16:18:51
R W Run
29.96 KB
2026-03-11 16:18:52
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
160 KB
2026-03-11 16:18:51
R W Run
6.72 KB
2026-03-11 16:18:52
R W Run
10.92 KB
2026-03-11 16:18:51
R W Run
4.77 KB
2026-03-11 16:18:51
R W Run
3.38 KB
2026-03-11 16:18:51
R W Run
11.18 KB
2026-03-11 16:18:51
R W Run
62.19 KB
2026-03-11 16:18:51
R W Run
2.46 KB
2026-03-11 16:18:51
R W Run
9.17 KB
2026-03-11 16:18:51
R W Run
32.15 KB
2026-03-11 16:18:51
R W Run
34.05 KB
2026-03-11 16:18:52
R W Run
7.15 KB
2026-03-11 16:18:51
R W Run
3.47 KB
2026-03-11 16:18:52
R W Run
1.87 KB
2026-03-11 16:18:52
R W Run
30.91 KB
2026-03-11 16:18:51
R W Run
7.29 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:51
R W Run
12.54 KB
2026-03-11 16:18:51
R W Run
19.12 KB
2026-03-11 16:18:51
R W Run
18.12 KB
2026-03-11 16:18:52
R W Run
39.99 KB
2026-03-11 16:18:52
R W Run
5.17 KB
2026-03-11 16:18:52
R W Run
979 By
2026-03-11 16:18:51
R W Run
18.44 KB
2026-03-11 16:18:52
R W Run
10.24 KB
2026-03-11 16:18:51
R W Run
1.77 KB
2026-03-11 16:18:52
R W Run
34.9 KB
2026-03-11 16:18:51
R W Run
7.19 KB
2026-03-11 16:18:52
R W Run
160.5 KB
2026-03-11 16:18:51
R W Run
64.27 KB
2026-03-11 16:18:51
R W Run
27.95 KB
2026-03-11 16:18:51
R W Run
4.69 KB
2026-03-11 16:18:51
R W Run
2.94 KB
2026-03-11 16:18:51
R W Run
43.13 KB
2026-03-11 16:18:52
R W Run
2.25 KB
2026-03-11 16:18:52
R W Run
22.5 KB
2026-03-11 16:18:51
R W Run
13.01 KB
2026-03-11 16:18:52
R W Run
3.27 KB
2026-03-11 16:18:51
R W Run
18 KB
2026-03-11 16:18:51
R W Run
210.4 KB
2026-03-11 16:18:52
R W Run
25.86 KB
2026-03-11 16:18:52
R W Run
115.85 KB
2026-03-11 16:18:51
R W Run
373 By
2026-03-11 16:18:52
R W Run
343 By
2026-03-11 16:18:52
R W Run
338 By
2026-03-11 16:18:51
R W Run
100.73 KB
2026-03-11 16:18:52
R W Run
130.93 KB
2026-03-11 16:18:51
R W Run
19.1 KB
2026-03-11 16:18:51
R W Run
17.41 KB
2026-03-11 16:18:52
R W Run
41.98 KB
2026-03-11 16:18:52
R W Run
400 By
2026-03-11 16:18:52
R W Run
11.1 KB
2026-03-11 16:18:52
R W Run
37.02 KB
2026-03-11 16:18:51
R W Run
2.24 KB
2026-03-11 16:18:51
R W Run
188.13 KB
2026-03-11 16:18:51
R W Run
338 By
2026-03-11 16:18:51
R W Run
38 KB
2026-03-11 16:18:51
R W Run
4.02 KB
2026-03-11 16:18:52
R W Run
5.38 KB
2026-03-11 16:18:51
R W Run
3.05 KB
2026-03-11 16:18:52
R W Run
2.61 KB
2026-03-11 16:18:51
R W Run
1.16 KB
2026-03-11 16:18:52
R W Run
4.04 KB
2026-03-11 16:18:51
R W Run
3.71 KB
2026-03-11 16:18:51
R W Run
24.6 KB
2026-03-11 16:18:51
R W Run
9.56 KB
2026-03-11 16:18:51
R W Run
346.43 KB
2026-03-11 16:18:52
R W Run
281.84 KB
2026-03-11 16:18:52
R W Run
14.95 KB
2026-03-11 16:18:51
R W Run
8.44 KB
2026-03-11 16:18:52
R W Run
168.95 KB
2026-03-11 16:18:52
R W Run
20.71 KB
2026-03-11 16:18:52
R W Run
25.27 KB
2026-03-11 16:18:51
R W Run
5.72 KB
2026-03-11 16:18:51
R W Run
4.63 KB
2026-03-11 16:18:52
R W Run
81.73 KB
2026-03-11 16:18:51
R W Run
67.18 KB
2026-03-11 16:18:51
R W Run
156.36 KB
2026-03-11 16:18:52
R W Run
55.19 KB
2026-03-11 16:18:51
R W Run
162 By
2026-03-11 16:18:51
R W Run
61.72 KB
2026-03-11 16:18:51
R W Run
216.06 KB
2026-03-11 16:18:52
R W Run
65.09 KB
2026-03-11 16:18:51
R W Run
25.24 KB
2026-03-11 16:18:52
R W Run
4.81 KB
2026-03-11 16:18:51
R W Run
6.48 KB
2026-03-11 16:18:52
R W Run
21.25 KB
2026-03-11 16:18:51
R W Run
2.79 KB
2026-03-11 16:18:52
R W Run
89.69 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:52
R W Run
3.69 KB
2026-03-11 16:18:52
R W Run
4.11 KB
2026-03-11 16:18:51
R W Run
40.74 KB
2026-03-11 16:18:51
R W Run
25.38 KB
2026-03-11 16:18:51
R W Run
43.31 KB
2026-03-11 16:18:52
R W Run
102.57 KB
2026-03-11 16:18:52
R W Run
6.18 KB
2026-03-11 16:18:51
R W Run
124.47 KB
2026-03-11 16:18:52
R W Run
35.65 KB
2026-03-11 16:18:52
R W Run
6.94 KB
2026-03-11 16:18:52
R W Run
67.04 KB
2026-03-11 16:18:52
R W Run
10.62 KB
2026-03-11 16:18:51
R W Run
289.35 KB
2026-03-11 16:18:52
R W Run
36.23 KB
2026-03-11 16:18:51
R W Run
200 By
2026-03-11 16:18:52
R W Run
200 By
2026-03-11 16:18:52
R W Run
98.29 KB
2026-03-11 16:18:52
R W Run
30.02 KB
2026-03-11 16:18:52
R W Run
19.03 KB
2026-03-11 16:18:52
R W Run
5.06 KB
2026-03-11 16:18:52
R W Run
255 By
2026-03-11 16:18:51
R W Run
22.66 KB
2026-03-11 16:18:52
R W Run
154.63 KB
2026-03-11 16:18:51
R W Run
9.68 KB
2026-03-11 16:18:51
R W Run
258 By
2026-03-11 16:18:51
R W Run
23.49 KB
2026-03-11 16:18:51
R W Run
3.16 KB
2026-03-11 16:18:51
R W Run
8.4 KB
2026-03-11 16:18:52
R W Run
441 By
2026-03-11 16:18:51
R W Run
7.39 KB
2026-03-11 16:18:51
R W Run
173 KB
2026-03-11 16:18:52
R W Run
544 By
2026-03-11 16:18:52
R W Run
4.17 KB
2026-03-11 16:18:51
R W Run
35.97 KB
2026-03-11 16:18:52
R W Run
1.69 KB
2026-03-11 16:18:51
R W Run
2.84 KB
2026-03-11 16:18:52
R W Run
6.09 KB
2026-03-11 16:18:51
R W Run
8.71 KB
2026-03-11 16:18:51
R W Run
131.84 KB
2026-03-11 16:18:51
R W Run
37.45 KB
2026-03-11 16:18:51
R W Run
173.89 KB
2026-03-11 16:18:51
R W Run
7.09 KB
2026-03-11 16:18:51
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
1.08 KB
2026-03-11 16:18:51
R W Run
69.46 KB
2026-03-11 16:18:52
R W Run
445 By
2026-03-11 16:18:51
R W Run
799 By
2026-03-11 16:18:52
R W Run
error_log
📄class-wp-image-editor.php
1<?php
2/**
3 * Base WordPress Image Editor
4 *
5 * @package WordPress
6 * @subpackage Image_Editor
7 */
8
9/**
10 * Base image editor class from which implementations extend
11 *
12 * @since 3.5.0
13 */
14#[AllowDynamicProperties]
15abstract class WP_Image_Editor {
16 protected $file = null;
17 protected $size = null;
18 protected $mime_type = null;
19 protected $output_mime_type = null;
20 protected $default_mime_type = 'image/jpeg';
21 protected $quality = false;
22
23 // Deprecated since 5.8.1. See get_default_quality() below.
24 protected $default_quality = 82;
25
26 /**
27 * Each instance handles a single file.
28 *
29 * @param string $file Path to the file to load.
30 */
31 public function __construct( $file ) {
32 $this->file = $file;
33 }
34
35 /**
36 * Checks to see if current environment supports the editor chosen.
37 * Must be overridden in a subclass.
38 *
39 * @since 3.5.0
40 *
41 * @abstract
42 *
43 * @param array $args
44 * @return bool
45 */
46 public static function test( $args = array() ) {
47 return false;
48 }
49
50 /**
51 * Checks to see if editor supports the mime-type specified.
52 * Must be overridden in a subclass.
53 *
54 * @since 3.5.0
55 *
56 * @abstract
57 *
58 * @param string $mime_type
59 * @return bool
60 */
61 public static function supports_mime_type( $mime_type ) {
62 return false;
63 }
64
65 /**
66 * Loads image from $this->file into editor.
67 *
68 * @since 3.5.0
69 *
70 * @return true|WP_Error True if loaded; WP_Error on failure.
71 */
72 abstract public function load();
73
74 /**
75 * Saves current image to file.
76 *
77 * @since 3.5.0
78 * @since 6.0.0 The `$filesize` value was added to the returned array.
79 *
80 * @param string $destfilename Optional. Destination filename. Default null.
81 * @param string $mime_type Optional. The mime-type. Default null.
82 * @return array|WP_Error {
83 * Array on success or WP_Error if the file failed to save.
84 *
85 * @type string $path Path to the image file.
86 * @type string $file Name of the image file.
87 * @type int $width Image width.
88 * @type int $height Image height.
89 * @type string $mime-type The mime type of the image.
90 * @type int $filesize File size of the image.
91 * }
92 */
93 abstract public function save( $destfilename = null, $mime_type = null );
94
95 /**
96 * Resizes current image.
97 *
98 * At minimum, either a height or width must be provided.
99 * If one of the two is set to null, the resize will
100 * maintain aspect ratio according to the provided dimension.
101 *
102 * @since 3.5.0
103 *
104 * @param int|null $max_w Image width.
105 * @param int|null $max_h Image height.
106 * @param bool|array $crop {
107 * Optional. Image cropping behavior. If false, the image will be scaled (default).
108 * If true, image will be cropped to the specified dimensions using center positions.
109 * If an array, the image will be cropped using the array to specify the crop location:
110 *
111 * @type string $0 The x crop position. Accepts 'left', 'center', or 'right'.
112 * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'.
113 * }
114 * @return true|WP_Error
115 */
116 abstract public function resize( $max_w, $max_h, $crop = false );
117
118 /**
119 * Resize multiple images from a single source.
120 *
121 * @since 3.5.0
122 *
123 * @param array $sizes {
124 * An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
125 *
126 * @type array ...$0 {
127 * @type int $width Image width.
128 * @type int $height Image height.
129 * @type bool|array $crop Optional. Whether to crop the image. Default false.
130 * }
131 * }
132 * @return array An array of resized images metadata by size.
133 */
134 abstract public function multi_resize( $sizes );
135
136 /**
137 * Crops Image.
138 *
139 * @since 3.5.0
140 *
141 * @param int $src_x The start x position to crop from.
142 * @param int $src_y The start y position to crop from.
143 * @param int $src_w The width to crop.
144 * @param int $src_h The height to crop.
145 * @param int $dst_w Optional. The destination width.
146 * @param int $dst_h Optional. The destination height.
147 * @param bool $src_abs Optional. If the source crop points are absolute.
148 * @return true|WP_Error
149 */
150 abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
151
152 /**
153 * Rotates current image counter-clockwise by $angle.
154 *
155 * @since 3.5.0
156 *
157 * @param float $angle
158 * @return true|WP_Error
159 */
160 abstract public function rotate( $angle );
161
162 /**
163 * Flips current image.
164 *
165 * @since 3.5.0
166 *
167 * @param bool $horz Flip along Horizontal Axis
168 * @param bool $vert Flip along Vertical Axis
169 * @return true|WP_Error
170 */
171 abstract public function flip( $horz, $vert );
172
173 /**
174 * Streams current image to browser.
175 *
176 * @since 3.5.0
177 *
178 * @param string $mime_type The mime type of the image.
179 * @return true|WP_Error True on success, WP_Error object on failure.
180 */
181 abstract public function stream( $mime_type = null );
182
183 /**
184 * Gets dimensions of image.
185 *
186 * @since 3.5.0
187 *
188 * @return int[] {
189 * Dimensions of the image.
190 *
191 * @type int $width The image width.
192 * @type int $height The image height.
193 * }
194 */
195 public function get_size() {
196 return $this->size;
197 }
198
199 /**
200 * Sets current image size.
201 *
202 * @since 3.5.0
203 *
204 * @param int $width
205 * @param int $height
206 * @return true
207 */
208 protected function update_size( $width = null, $height = null ) {
209 $this->size = array(
210 'width' => (int) $width,
211 'height' => (int) $height,
212 );
213 return true;
214 }
215
216 /**
217 * Gets the Image Compression quality on a 1-100% scale.
218 *
219 * @since 4.0.0
220 *
221 * @return int Compression Quality. Range: [1,100]
222 */
223 public function get_quality() {
224 if ( ! $this->quality ) {
225 $this->set_quality();
226 }
227
228 return $this->quality;
229 }
230
231 /**
232 * Sets Image Compression quality on a 1-100% scale.
233 *
234 * @since 3.5.0
235 * @since 6.8.0 The `$dims` parameter was added.
236 *
237 * @param int $quality Compression Quality. Range: [1,100]
238 * @param array $dims Optional. Image dimensions array with 'width' and 'height' keys.
239 * @return true|WP_Error True if set successfully; WP_Error on failure.
240
241 */
242 public function set_quality( $quality = null, $dims = array() ) {
243 // Use the output mime type if present. If not, fall back to the input/initial mime type.
244 $mime_type = ! empty( $this->output_mime_type ) ? $this->output_mime_type : $this->mime_type;
245 // Get the default quality setting for the mime type.
246 $default_quality = $this->get_default_quality( $mime_type );
247
248 if ( null === $quality ) {
249 /**
250 * Filters the default image compression quality setting.
251 *
252 * Applies only during initial editor instantiation, or when set_quality() is run
253 * manually without the `$quality` argument.
254 *
255 * The WP_Image_Editor::set_quality() method has priority over the filter.
256 *
257 * @since 3.5.0
258 * @since 6.8.0 Added the size parameter.
259 *
260 * @param int $quality Quality level between 1 (low) and 100 (high).
261 * @param string $mime_type Image mime type.
262 * @param array $size {
263 * Dimensions of the image.
264 *
265 * @type int $width The image width.
266 * @type int $height The image height.
267 * }
268 */
269 $quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type, $dims ? $dims : $this->size );
270
271 if ( 'image/jpeg' === $mime_type ) {
272 /**
273 * Filters the JPEG compression quality for backward-compatibility.
274 *
275 * Applies only during initial editor instantiation, or when set_quality() is run
276 * manually without the `$quality` argument.
277 *
278 * The WP_Image_Editor::set_quality() method has priority over the filter.
279 *
280 * The filter is evaluated under two contexts: 'image_resize', and 'edit_image',
281 * (when a JPEG image is saved to file).
282 *
283 * @since 2.5.0
284 *
285 * @param int $quality Quality level between 0 (low) and 100 (high) of the JPEG.
286 * @param string $context Context of the filter.
287 */
288 $quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
289 }
290
291 if ( $quality < 0 || $quality > 100 ) {
292 $quality = $default_quality;
293 }
294 }
295
296 // Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.
297 if ( 0 === $quality ) {
298 $quality = 1;
299 }
300
301 if ( ( $quality >= 1 ) && ( $quality <= 100 ) ) {
302 $this->quality = $quality;
303 return true;
304 } else {
305 return new WP_Error( 'invalid_image_quality', __( 'Attempted to set image quality outside of the range [1,100].' ) );
306 }
307 }
308
309 /**
310 * Returns the default compression quality setting for the mime type.
311 *
312 * @since 5.8.1
313 *
314 * @param string $mime_type
315 * @return int The default quality setting for the mime type.
316 */
317 protected function get_default_quality( $mime_type ) {
318 switch ( $mime_type ) {
319 case 'image/webp':
320 $quality = 86;
321 break;
322 case 'image/jpeg':
323 default:
324 $quality = $this->default_quality;
325 }
326
327 return $quality;
328 }
329
330 /**
331 * Returns preferred mime-type and extension based on provided
332 * file's extension and mime, or current file's extension and mime.
333 *
334 * Will default to $this->default_mime_type if requested is not supported.
335 *
336 * Provides corrected filename only if filename is provided.
337 *
338 * @since 3.5.0
339 *
340 * @param string $filename
341 * @param string $mime_type
342 * @return array { filename|null, extension, mime-type }
343 */
344 protected function get_output_format( $filename = null, $mime_type = null ) {
345 $new_ext = null;
346
347 // By default, assume specified type takes priority.
348 if ( $mime_type ) {
349 $new_ext = $this->get_extension( $mime_type );
350 }
351
352 if ( $filename ) {
353 $file_ext = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
354 $file_mime = $this->get_mime_type( $file_ext );
355 } else {
356 // If no file specified, grab editor's current extension and mime-type.
357 $file_ext = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
358 $file_mime = $this->mime_type;
359 }
360
361 /*
362 * Check to see if specified mime-type is the same as type implied by
363 * file extension. If so, prefer extension from file.
364 */
365 if ( ! $mime_type || ( $file_mime === $mime_type ) ) {
366 $mime_type = $file_mime;
367 $new_ext = $file_ext;
368 }
369
370 $output_format = wp_get_image_editor_output_format( $filename, $mime_type );
371
372 if ( isset( $output_format[ $mime_type ] )
373 && $this->supports_mime_type( $output_format[ $mime_type ] )
374 ) {
375 $mime_type = $output_format[ $mime_type ];
376 $new_ext = $this->get_extension( $mime_type );
377 }
378
379 /*
380 * Double-check that the mime-type selected is supported by the editor.
381 * If not, choose a default instead.
382 */
383 if ( ! $this->supports_mime_type( $mime_type ) ) {
384 /**
385 * Filters default mime type prior to getting the file extension.
386 *
387 * @see wp_get_mime_types()
388 *
389 * @since 3.5.0
390 *
391 * @param string $mime_type Mime type string.
392 */
393 $mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );
394 $new_ext = $this->get_extension( $mime_type );
395 }
396
397 /*
398 * Ensure both $filename and $new_ext are not empty.
399 * $this->get_extension() returns false on error which would effectively remove the extension
400 * from $filename. That shouldn't happen, files without extensions are not supported.
401 */
402 if ( $filename && $new_ext ) {
403 $dir = pathinfo( $filename, PATHINFO_DIRNAME );
404 $ext = pathinfo( $filename, PATHINFO_EXTENSION );
405
406 $filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}";
407 }
408
409 if ( $mime_type && ( $mime_type !== $this->mime_type ) ) {
410 // The image will be converted when saving. Set the quality for the new mime-type if not already set.
411 if ( $mime_type !== $this->output_mime_type ) {
412 $this->output_mime_type = $mime_type;
413 }
414 $this->set_quality();
415 } elseif ( ! empty( $this->output_mime_type ) ) {
416 // Reset output_mime_type and quality.
417 $this->output_mime_type = null;
418 $this->set_quality();
419 }
420
421 return array( $filename, $new_ext, $mime_type );
422 }
423
424 /**
425 * Builds an output filename based on current file, and adding proper suffix
426 *
427 * @since 3.5.0
428 * @since 6.8.0 Passing an empty string as $suffix will now omit the suffix from the generated filename.
429 *
430 * @param string $suffix
431 * @param string $dest_path
432 * @param string $extension
433 * @return string filename
434 */
435 public function generate_filename( $suffix = null, $dest_path = null, $extension = null ) {
436 // If not empty the $suffix will be appended to the destination filename, just before the extension.
437 if ( $suffix ) {
438 $suffix = '-' . $suffix;
439 } elseif ( '' !== $suffix ) {
440 $suffix = '-' . $this->get_suffix();
441 }
442
443 $dir = pathinfo( $this->file, PATHINFO_DIRNAME );
444 $ext = pathinfo( $this->file, PATHINFO_EXTENSION );
445
446 $name = wp_basename( $this->file, ".$ext" );
447 $new_ext = strtolower( $extension ? $extension : $ext );
448
449 if ( ! is_null( $dest_path ) ) {
450 if ( ! wp_is_stream( $dest_path ) ) {
451 $_dest_path = realpath( $dest_path );
452 if ( $_dest_path ) {
453 $dir = $_dest_path;
454 }
455 } else {
456 $dir = $dest_path;
457 }
458 }
459
460 return trailingslashit( $dir ) . "{$name}{$suffix}.{$new_ext}";
461 }
462
463 /**
464 * Builds and returns proper suffix for file based on height and width.
465 *
466 * @since 3.5.0
467 *
468 * @return string|false suffix
469 */
470 public function get_suffix() {
471 if ( ! $this->get_size() ) {
472 return false;
473 }
474
475 return "{$this->size['width']}x{$this->size['height']}";
476 }
477
478 /**
479 * Check if a JPEG image has EXIF Orientation tag and rotate it if needed.
480 *
481 * @since 5.3.0
482 *
483 * @return bool|WP_Error True if the image was rotated. False if not rotated (no EXIF data or the image doesn't need to be rotated).
484 * WP_Error if error while rotating.
485 */
486 public function maybe_exif_rotate() {
487 $orientation = null;
488
489 if ( is_callable( 'exif_read_data' ) && 'image/jpeg' === $this->mime_type ) {
490 $exif_data = @exif_read_data( $this->file );
491
492 if ( ! empty( $exif_data['Orientation'] ) ) {
493 $orientation = (int) $exif_data['Orientation'];
494 }
495 }
496
497 /**
498 * Filters the `$orientation` value to correct it before rotating or to prevent rotating the image.
499 *
500 * @since 5.3.0
501 *
502 * @param int $orientation EXIF Orientation value as retrieved from the image file.
503 * @param string $file Path to the image file.
504 */
505 $orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation, $this->file );
506
507 if ( ! $orientation || 1 === $orientation ) {
508 return false;
509 }
510
511 switch ( $orientation ) {
512 case 2:
513 // Flip horizontally.
514 $result = $this->flip( false, true );
515 break;
516 case 3:
517 /*
518 * Rotate 180 degrees or flip horizontally and vertically.
519 * Flipping seems faster and uses less resources.
520 */
521 $result = $this->flip( true, true );
522 break;
523 case 4:
524 // Flip vertically.
525 $result = $this->flip( true, false );
526 break;
527 case 5:
528 // Rotate 90 degrees counter-clockwise and flip vertically.
529 $result = $this->rotate( 90 );
530
531 if ( ! is_wp_error( $result ) ) {
532 $result = $this->flip( true, false );
533 }
534
535 break;
536 case 6:
537 // Rotate 90 degrees clockwise (270 counter-clockwise).
538 $result = $this->rotate( 270 );
539 break;
540 case 7:
541 // Rotate 90 degrees counter-clockwise and flip horizontally.
542 $result = $this->rotate( 90 );
543
544 if ( ! is_wp_error( $result ) ) {
545 $result = $this->flip( false, true );
546 }
547
548 break;
549 case 8:
550 // Rotate 90 degrees counter-clockwise.
551 $result = $this->rotate( 90 );
552 break;
553 }
554
555 return $result;
556 }
557
558 /**
559 * Either calls editor's save function or handles file as a stream.
560 *
561 * @since 3.5.0
562 *
563 * @param string $filename
564 * @param callable $callback
565 * @param array $arguments
566 * @return bool
567 */
568 protected function make_image( $filename, $callback, $arguments ) {
569 $stream = wp_is_stream( $filename );
570 if ( $stream ) {
571 ob_start();
572 } else {
573 // The directory containing the original file may no longer exist when using a replication plugin.
574 wp_mkdir_p( dirname( $filename ) );
575 }
576
577 $result = call_user_func_array( $callback, $arguments );
578
579 if ( $result && $stream ) {
580 $contents = ob_get_contents();
581
582 $fp = fopen( $filename, 'w' );
583
584 if ( ! $fp ) {
585 ob_end_clean();
586 return false;
587 }
588
589 fwrite( $fp, $contents );
590 fclose( $fp );
591 }
592
593 if ( $stream ) {
594 ob_end_clean();
595 }
596
597 return $result;
598 }
599
600 /**
601 * Returns first matched mime-type from extension,
602 * as mapped from wp_get_mime_types()
603 *
604 * @since 3.5.0
605 *
606 * @param string $extension
607 * @return string|false
608 */
609 protected static function get_mime_type( $extension = null ) {
610 if ( ! $extension ) {
611 return false;
612 }
613
614 $mime_types = wp_get_mime_types();
615 $extensions = array_keys( $mime_types );
616
617 foreach ( $extensions as $_extension ) {
618 if ( preg_match( "/{$extension}/i", $_extension ) ) {
619 return $mime_types[ $_extension ];
620 }
621 }
622
623 return false;
624 }
625
626 /**
627 * Returns first matched extension from Mime-type,
628 * as mapped from wp_get_mime_types()
629 *
630 * @since 3.5.0
631 *
632 * @param string $mime_type
633 * @return string|false
634 */
635 protected static function get_extension( $mime_type = null ) {
636 if ( empty( $mime_type ) ) {
637 return false;
638 }
639
640 return wp_get_default_extension_for_mime_type( $mime_type );
641 }
642}
643
Ui Ux Design – Teachers Night Out https://cardgames4educators.com Wed, 16 Oct 2024 22:24:18 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://cardgames4educators.com/wp-content/uploads/2024/06/cropped-Card-4-Educators-logo-32x32.png Ui Ux Design – Teachers Night Out https://cardgames4educators.com 32 32 Masters In English How English Speaker https://cardgames4educators.com/masters-in-english-how-english-speaker/ https://cardgames4educators.com/masters-in-english-how-english-speaker/#comments Mon, 27 May 2024 08:54:45 +0000 https://themexriver.com/wp/kadu/?p=1

Erat himenaeos neque id sagittis massa. Hac suscipit pulvinar dignissim platea magnis eu. Don tellus a pharetra inceptos efficitur dui pulvinar. Feugiat facilisis penatibus pulvinar nunc dictumst donec odio platea habitasse. Lacus porta dolor purus elit ante bibendum tortor netus taciti nullam cubilia. Erat per suspendisse placerat morbi egestas pulvinar bibendum sollicitudin nec. Euismod cubilia eleifend velit himenaeos sodales lectus. Leo maximus cras ac porttitor aliquam torquent pulvinar odio volutpat parturient. Quisque risus finibus suspendisse mus purus magnis facilisi condimentum consectetur dui. Curae elit suspendisse cursus vehicula.

Turpis taciti class non vel pretium quis pulvinar tempor lobortis nunc. Libero phasellus parturient sapien volutpat malesuada ornare. Cubilia dignissim sollicitudin rhoncus lacinia maximus. Cras lorem fermentum bibendum pellentesque nisl etiam ligula enim cubilia. Vulputate pede sapien torquent montes tempus malesuada in mattis dis turpis vitae. Porta est tempor ex eget feugiat vulputate ipsum. Justo nec iaculis habitant diam arcu fermentum.

We offer comprehen sive emplo ment services such as assistance wit employer compliance.Our company is your strategic HR partner as instead of HR. john smithson

Cubilia dignissim sollicitudin rhoncus lacinia maximus. Cras lorem fermentum bibendum pellentesque nisl etiam ligula enim cubilia. Vulputate pede sapien torquent montes tempus malesuada in mattis dis turpis vitae.

Exploring Learning Landscapes in Academic

Feugiat facilisis penatibus pulvinar nunc dictumst donec odio platea habitasse. Lacus porta dolor purus elit ante bibendum tortor netus taciti nullam cubilia. Erat per suspendisse placerat morbi egestas pulvinar bibendum sollicitudin nec. Euismod cubilia eleifend velit himenaeos sodales lectus. Leo maximus cras ac porttitor aliquam torquent.

]]>
https://cardgames4educators.com/masters-in-english-how-english-speaker/feed/ 1