These are chat archives for matiasgagliano/guillotine

25th
Jun 2015
CristhianSalta
@CristhianSalta
Jun 25 2015 13:41
Hello. I am having troubles with small images
CristhianSalta
@CristhianSalta
Jun 25 2015 13:50
Issue.png

This is my code:
$('#imgPhoto_PersonTab').attr('src', e.target.result);
picture = $('#imgPhoto_PersonTab'); // Must be already loaded or cached!
picture.guillotine({ width: 250, height: 250 });

And I don't know why my picture is distorting with that params.

It is a cached image. But I don't think that this is my problem at all...
Matías Gagliano
@matiasgagliano
Jun 25 2015 20:14

Hi @CristhianSalta, given that you are setting the 'src' dynamically the image might not be completely loaded when you initialize the plugin (as the comment says) causing size issues. It's a common issue (#3, #18, etc.) among newcomers, so you might want to start by wrapping the call to the plugin inside the picture's onload event and rule that one out. Check the code from the demo to get a better idea of what I'm talking about.

If you still get errors please check that you don't have any extra CSS that might be distorting the image and post the image's markup (before the plugin is initialized) and anything else that could help debug the issue.