• I’m using a dutch Locale, and because numbers are formatted with a comma instead of a floating point (I don’t know why). It goes all wrong, I can’t crop anymore in the back end. Hopefully you guys can fix this.

    The temp solution I found:

    setTimeout(function() { 
    				$('#jcrop_target').Jcrop({
    					onChange: showPreview,
    					onSelect: showPreview,
    					minSize: [<?php echo $minWidth; ?>, <?php echo $minHeight; ?>],
    					maxSize: [<?php echo $previewWidth; ?>, <?php echo $previewHeight; ?>],
    					<?php if ( isset( $metaData['micSelectedArea'][$editedSize] ) ) { ?>
    						setSelect: [<?php echo number_format(max(0, $metaData['micSelectedArea'][$editedSize]['x']), 2, '.', '') ?>, <?php echo number_format(max(0, $metaData['micSelectedArea'][$editedSize]['y']), 2, '.', '') ?>, <?php echo number_format(max(0, $metaData['micSelectedArea'][$editedSize]['x']) + $metaData['micSelectedArea'][$editedSize]['w'], 2, '.', ''); ?>, <?php echo number_format(max(0, $metaData['micSelectedArea'][$editedSize]['y']) + $metaData['micSelectedArea'][$editedSize]['h'], 2, '.', ''); ?>],
    					<?php }else { ?>
    						setSelect: [<?php echo number_format(max(0, ($previewWidth - ($previewHeight * $aspectRatio)) / 2), 2, '.', '') ?>, <?php echo number_format(max(0, ($previewHeight - ($previewWidth / $aspectRatio)) / 2), 2, '.', '') ?>, <?php echo number_format($previewWidth * $aspectRatio, 2, '.', ''); ?>, <?php echo number_format($previewHeight, 2, '.', ''); ?>],
    					<?php }?>
    					aspectRatio: <?php echo number_format($aspectRatio, 2, '.', '') ?>,
    				}, function() {
    					jcrop_api = this;
    				});
    			}, 300);

    Is number formatting the outcome in ManualImageCropEditorWindow.php starting from line 248.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DannyvanHolten

    (@dannyvanholten)

    And the following as well:

    var rx = <?php echo number_format($smallPreviewWidth, 2, '.', ''); ?> / coords.w;
    				var ry = <?php echo number_format($smallPreviewHeight, 2, '.', ''); ?> / coords.h;

    on line 266 & 267

    Thread Starter DannyvanHolten

    (@dannyvanholten)

    Dear developer,

    Can you at least give a reaction or an estimate when this will be resolved?
    I feel obliged to fork it, and start my own. Which is strictly seen not allowed …

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number formatting error’ is closed to new replies.