Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#43668 new defect (bug)

Image cropping fails for many PHP locales, if set

Reported by: knutsp's profile knutsp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: dev-feedback
Focuses: javascript Cc:


setlocale( LC_NUMERIC /*or LC_ALL */, 'nb_NO' );

is used then Media image cropping fails and selection input fields show Infinity. It works fine with 'en_US', btw.

If #17268 is implemented, I guess it includes use of `setlocale'.

Anyway, image cropping, and other internal passing of numeric data insede an application, should work independently of how numbers are to displayed according to a locale.

I don't know which file or script to look into, to suggest a patch. Any help appreciated.

Change History (3)

#1 @joemcgill
5 years ago

  • Keywords reporter-feedback added

Hi @knutsp,

I'm not able to reproduce this bug in WP 5.2-beta3. Can you confirm that this is still an issue, and if so, clarify the steps you used to reproduce this bug?


#2 @knutsp
5 years ago

  • Keywords dev-feedback added; reporter-feedback removed

The bug is still there in latest beta.

Install on PHP 7.3.3. Add ´setlocale´ to ´wp-config.php´ with a valid PHP locale string (important).

Using Firefox latest, upload an image to Media. Click "Edit Image" button. Drag the mouse pointer on the image to make a rectangle. Observe Selection field values being filled with Infinity.

Last edited 5 years ago by knutsp (previous) (diff)

#3 @marcelschulz
2 years ago

This bug still exists as of March 2022 (5.9.2).
We're setting another locale (setlocale(LC_ALL, 'de_DE.UTF-8');) which breaks image cropping in media library as described before.

Have you ever found a solution to it?

Last edited 2 years ago by marcelschulz (previous) (diff)
Note: See TracTickets for help on using tickets.