Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakrohillas authored Nov 2, 2024
2 parents bac46e8 + b1b5761 commit 7176f6f
Show file tree
Hide file tree
Showing 21 changed files with 426 additions and 336 deletions.
382 changes: 191 additions & 191 deletions package-lock.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,58 +83,58 @@
"@wordpress/api-fetch": "7.8.2",
"@wordpress/autop": "4.8.1",
"@wordpress/blob": "4.8.1",
"@wordpress/block-directory": "5.8.11",
"@wordpress/block-editor": "14.3.9",
"@wordpress/block-library": "9.8.10",
"@wordpress/block-directory": "5.8.14",
"@wordpress/block-editor": "14.3.11",
"@wordpress/block-library": "9.8.12",
"@wordpress/block-serialization-default-parser": "5.8.1",
"@wordpress/blocks": "13.8.5",
"@wordpress/commands": "1.8.8",
"@wordpress/components": "28.8.8",
"@wordpress/commands": "1.8.9",
"@wordpress/components": "28.8.9",
"@wordpress/compose": "7.8.3",
"@wordpress/core-commands": "1.8.9",
"@wordpress/core-data": "7.8.9",
"@wordpress/customize-widgets": "5.8.10",
"@wordpress/core-commands": "1.8.11",
"@wordpress/core-data": "7.8.11",
"@wordpress/customize-widgets": "5.8.12",
"@wordpress/data": "10.8.3",
"@wordpress/data-controls": "4.8.3",
"@wordpress/dataviews": "4.4.8",
"@wordpress/dataviews": "4.4.9",
"@wordpress/date": "5.8.2",
"@wordpress/deprecated": "4.8.2",
"@wordpress/dom": "4.8.2",
"@wordpress/dom-ready": "4.8.1",
"@wordpress/edit-post": "8.8.11",
"@wordpress/edit-site": "6.8.11",
"@wordpress/edit-widgets": "6.8.10",
"@wordpress/editor": "14.8.11",
"@wordpress/edit-post": "8.8.14",
"@wordpress/edit-site": "6.8.14",
"@wordpress/edit-widgets": "6.8.12",
"@wordpress/editor": "14.8.14",
"@wordpress/element": "6.8.1",
"@wordpress/escape-html": "3.8.1",
"@wordpress/fields": "0.0.10",
"@wordpress/format-library": "5.8.9",
"@wordpress/fields": "0.0.12",
"@wordpress/format-library": "5.8.11",
"@wordpress/hooks": "4.8.2",
"@wordpress/html-entities": "4.8.1",
"@wordpress/i18n": "5.8.2",
"@wordpress/icons": "10.8.2",
"@wordpress/interactivity": "6.8.5",
"@wordpress/interactivity-router": "2.8.6",
"@wordpress/interface": "6.8.8",
"@wordpress/interface": "6.8.9",
"@wordpress/is-shallow-equal": "5.8.1",
"@wordpress/keyboard-shortcuts": "5.8.3",
"@wordpress/keycodes": "4.8.2",
"@wordpress/list-reusable-blocks": "5.8.8",
"@wordpress/list-reusable-blocks": "5.8.9",
"@wordpress/media-utils": "5.8.2",
"@wordpress/notices": "5.8.3",
"@wordpress/nux": "9.8.8",
"@wordpress/patterns": "2.8.9",
"@wordpress/plugins": "7.8.8",
"@wordpress/preferences": "4.8.8",
"@wordpress/nux": "9.8.9",
"@wordpress/patterns": "2.8.11",
"@wordpress/plugins": "7.8.9",
"@wordpress/preferences": "4.8.9",
"@wordpress/preferences-persistence": "2.8.2",
"@wordpress/primitives": "4.8.1",
"@wordpress/priority-queue": "3.8.1",
"@wordpress/private-apis": "1.8.1",
"@wordpress/redux-routine": "5.8.1",
"@wordpress/reusable-blocks": "5.8.9",
"@wordpress/reusable-blocks": "5.8.11",
"@wordpress/rich-text": "7.8.3",
"@wordpress/router": "1.8.1",
"@wordpress/server-side-render": "5.8.8",
"@wordpress/server-side-render": "5.8.9",
"@wordpress/shortcode": "4.8.1",
"@wordpress/style-engine": "2.8.1",
"@wordpress/sync": "1.8.1",
Expand All @@ -143,7 +143,7 @@
"@wordpress/url": "4.8.1",
"@wordpress/viewport": "6.8.3",
"@wordpress/warning": "3.8.1",
"@wordpress/widgets": "4.8.9",
"@wordpress/widgets": "4.8.11",
"@wordpress/wordcount": "4.8.1",
"backbone": "1.6.0",
"clipboard": "2.0.11",
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@
</div>
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="data:image/svg+xml,%3Csvg width='436' height='436' viewbox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23ededed' /%3E%3C/svg%3E" alt="" height="436" width="436" />
<img src="https://s.w.org/images/core/6.7/feature-tt5.webp" alt="" height="436" width="436" />
</div>
</div>
</div>

<div class="about__section has-2-columns">
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="data:image/svg+xml,%3Csvg width='436' height='436' viewbox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23ededed' /%3E%3C/svg%3E" alt="" height="436" width="436" />
<img src="https://s.w.org/images/core/6.7/feature-zoom.webp" alt="" height="436" width="436" />
</div>
</div>
<div class="column is-vertically-aligned-center">
Expand All @@ -110,15 +110,15 @@
</div>
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="data:image/svg+xml,%3Csvg width='436' height='436' viewbox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23ededed' /%3E%3C/svg%3E" alt="" height="436" width="436" />
<img src="https://s.w.org/images/core/6.7/feature-block-bindings.png" alt="" height="436" width="436" />
</div>
</div>
</div>

<div class="about__section has-2-columns">
<div class="column is-vertically-aligned-center">
<div class="about__image">
<img src="data:image/svg+xml,%3Csvg width='436' height='436' viewbox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23ededed' /%3E%3C/svg%3E" alt="" height="436" width="436" />
<img src="https://s.w.org/images/core/6.7/feature-font-presets.png" alt="" height="436" width="436" />
</div>
</div>
<div class="column is-vertically-aligned-center">
Expand Down
33 changes: 29 additions & 4 deletions src/wp-admin/includes/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,55 @@ function wp_create_image_subsizes( $file, $attachment_id ) {
* If the original image's dimensions are over the threshold,
* scale the image and use it as the "full" size.
*/
$scale_down = false;
$convert = false;

if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {
// The image will be converted if needed on saving.
$scale_down = true;
} else {
// The image may need to be converted regardless of its dimensions.
$output_format = wp_get_image_editor_output_format( $file, $imagesize['mime'] );

if ( is_array( $output_format ) && array_key_exists( $imagesize['mime'], $output_format ) ) {
$convert = true;
}
}

if ( $scale_down || $convert ) {
$editor = wp_get_image_editor( $file );

if ( is_wp_error( $editor ) ) {
// This image cannot be edited.
return $image_meta;
}

// Resize the image.
$resized = $editor->resize( $threshold, $threshold );
if ( $scale_down ) {
// Resize the image. This will also convet it if needed.
$resized = $editor->resize( $threshold, $threshold );
} elseif ( $convert ) {
// The image will be converted (if possible) when saved.
$resized = true;
}

$rotated = null;

// If there is EXIF data, rotate according to EXIF Orientation.
if ( ! is_wp_error( $resized ) && is_array( $exif_meta ) ) {
$resized = $editor->maybe_exif_rotate();
$rotated = $resized;
$rotated = $resized; // bool true or WP_Error
}

if ( ! is_wp_error( $resized ) ) {
/*
* Append "-scaled" to the image file name. It will look like "my_image-scaled.jpg".
* This doesn't affect the sub-sizes names as they are generated from the original image (for best quality).
*/
$saved = $editor->save( $editor->generate_filename( 'scaled' ) );
if ( $scale_down ) {
$saved = $editor->save( $editor->generate_filename( 'scaled' ) );
} else {
$saved = $editor->save();
}

if ( ! is_wp_error( $saved ) ) {
$image_meta = _wp_image_meta_replace_original( $saved, $file, $image_meta, $attachment_id );
Expand Down
Loading

0 comments on commit 7176f6f

Please sign in to comment.