I think it would be a great feature for user to preview the cropped image before submitting.

Comments

sachbearbeiter’s picture

+1

yvmarques’s picture

The problem is that the epsacrop_thumb is use for the dialog, so it the same thumb for all styles, I can't refresh the thumb because I will never know which style I've to choose for the preview.

But I'm working on it, and thinking what is the best way to add a preview..

rogical’s picture

thanks, maybe we can add another thunmbnail style for preview, just under the original thunmbnail.

vivianspencer’s picture

This would be a great addition to the module, perhaps a section under the "manage image crops" which shows thumbnails of the different styles. Clicking on one of these thumbnails could then open the crop dialog on the selected style.

adamtong’s picture

I want to know how to do this too. Can you explain more clearly?

tasc’s picture

Issue summary: View changes

Old thread but still active.

I solved it by adding some custom js to reload the preview:

$(document).ajaxComplete(function(event, request, settings) {

	if (settings.url.indexOf('crop/ajax/put') > -1) {

		img = $('.field-name-YOUR-FIELD-NAME .image-preview img');
		ori_source = $(img).attr('src');

		timestamp = new Date().getTime();
		newSource = ori_source.split('&epsa-timestamp=' + $(img).attr('data-timestamp'), 1) + "&epsa-timestamp=" + timestamp;
		$(img).attr('data-timestamp', timestamp);
		$(img).attr('src', newSource);

	}
});