WordPress.org

Forums

Manual Image Crop
Cropping size do not match with the image size. (1 post)

  1. Mohsin Rasool
    Member
    Posted 11 months ago #

    Hello,

    First of all I really liked the plugin. It solves a crucial problem. I am having an issue. In the cropping area, the selection is bound to be square even when we have a rectangular shaped image size. I can see the javascript code to change the selection but it is always a square selection. I am posting a screenshot and the related JS code for your assistance.

    http://s2.postimg.org/l6stkgbzt/manual_image_crop.png

    jQuery(document).ready(function($) {
    	mic_attachment_id = 250;
    	mic_edited_size = 'thumb-250-70';
    	mic_preview_scale = 4.42;
    
    	setTimeout(function() {
    		$('#jcrop_target').Jcrop({
    			onChange: showPreview,
    			onSelect: showPreview,
    			minSize: [56.561085972851, 15.837104072398],
    			maxSize: [439.3665158371, 350],
    									setSelect: [0, 0, 551.55124353953, 350],
    								aspectRatio: 1.2553329023917,
    		}, function() {
    			jcrop_api = this;
    		});
    	}, 300);
    
    	function showPreview(coords) {
    		var rx = 180 / coords.w;
    		var ry = 143.38825952626 / coords.h;
    
    		$('#preview').css({
    			width: Math.round(rx * 439.3665158371)+ 'px',
    			height: Math.round(ry * 350) + 'px',
    			marginLeft: '-' + Math.round(rx * coords.x) + 'px',
    			marginTop: '-' + Math.round(ry * coords.y) + 'px'
    		});
    	}
    });
    </script>

    https://wordpress.org/plugins/manual-image-crop/

Reply

You must log in to post.

About this Plugin

  • Manual Image Crop
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic