jrac
jrac copied to clipboard
resizing large images
When source image has large size, sometimes image is displayed stretched. The issue seems to be caused by the following code:
var $zoom_widget = $('<div class="jrac_zoom_slider"><div class="ui-slider-handle"></div></div>')
.slider({
value: $image.width(),
min: settings.zoom_min,
max: settings.zoom_max,
start: function(event, ui) {
$.extend($zoom_widget,{
on_start_width_value: ui.value,
on_start_height_value: $image.height()
})
},
...
when image width is larger than zoom_max, corresponding height is calculated incorrectly when slider is toggled. Changing
on_start_width_value: ui.value
to
on_start_width_value: $image.width()
fixed the issue.