I have just released an update to imgAreaSelect with a version number of 0.9.1. It fixes a nasty bug found in version 0.9 that affected the initialization stage, causing some unexpected behavior (like not being able to set the initial selection) and JavaScript errors.
Thanks to all the people who noticed the bug and reported it to me.
Really great work, thanks a lot for this.
I have just done a post on my blog about using ImgAreaSelect with GD library to crop and create new thumbnails.
http://www.leonkessler.com/blog/?p=132
@Leon:
Great — I’ll add the link to your post to the plugin’s project page (http://odyniec.net/projects/imgareaselect/#links), if you don’t mind.
hi im trying to configure your plugin and have problem to change the area width height values.
i want to change the area size when i change the src image to new width and height.
code :
var ias = $(‘#designer-image’).imgAreaSelect({ instance:true, handles: true});
function change(newwidth,newheight) {
ias.update({ disable:true, hide:true});
ias.setOptions({imageWidth: newwidth, imageHeight:newheight});
ias.update();
ias.update({ enable:true, show:true});
ias.update();
}
but the new width and height values are not working. can you help me?
@birko:
You should be able to get imgAreaSelect to pick up the new image size simply by calling the
update()method when the new image has finished loading. Add aloadevent handler, e.g.:$('img').one('load', function () { $(this).imgAreaSelect({ instance: true }).update(); });Let me know if it works for you.
not working :/ . i must create new instance of imageareaselect to update width and height values .
Hi,
i’ve implemented this beautiful plugin and all works fine except this:
the outer area, in explorer 7, grows of 10 pixels when the selection is on the bottom of the image. The div pass from 1px to 10px instead of 0px. Anyone can help me to fix this?
On this site it doesn’t seem to do the same thing.
@Anija:
Can you show me a live example of the issue that you’re having, or the appropriate code fragments? Feel free to contact me by e-mail.
I’ve enjoyed implimenting your code, however… I can’t get the setSelection to work after page load.
Basicly, i’m loading an image into 3 img tags, and want to set a different selection on each.
I’ve run some tests, and it seems that imgOfs is undefined, so any routine requiring it fails. Also, tapping into the underlying instance doesn’t help either.
Thanks!
Hi, great plugin, I am planning on using it on a project of mine.
Is there an easy way to have multiple boxes on an image, or will have have to hack it myself?
thanks
fritz
@fritzthecat:
Only one selection area per image is supported, so if you need more, you’ll have to hack it. Some people have already implemented such things based on this plugin — for example, if you need an image tagging solution, there’s Tarique Sani’s Img Notes plugin: http://plugins.jquery.com/project/ImgNotes.
Will it work with jQuery-1.4 ?
Yes, I tested the plugin and it works with jQuery 1.4.1.
Hi Michal!
Yes it’s just great script!
I would like to make sure if I could use it for a commercial project?
TAHNX!
I mean THANKS!
@Jay: Sure, it’s free for commercial use (dual MIT/GPL license).
Hey dude,
Cheers for the script I do love it. Have to say i feel bad after reading everyboies questions and now adding my own
I am using imageHeight and imageWidth to tell the script the original image heights. The reason being that the thumbnail i do not want to use the original images size, as these could be up to 4000px for my camera.If i add imageHeight and imageWidth then the preview image does not display correctly and if i don’t use it the images don’t crop properly once processed. I have tried .update() at the end of it but this seems to just break my script, not with errors just functionality.
onSelectChange: preview, imageHeight: uploaded_height_origi, imageWidth: uploaded_width_origi)}.update()
Any ides how i can get round this problem and still use a small scaled thumbnail?
Cheers again dude for the script
So i’ve worked on it for the last 2 days and come up the real problem, sadly not a solution yet though.
I have a fixed height of 375 and width of 750 as this is the size of the saved thumbnail. selection.width and selection.height are causing the troubles. As seen below
Non-working heights and widths
scaleX: 750 / 76 Total = 9.868421052631579
scaleY: 375 / 7 Total = 53.57142857142857
Correct heights and widths
scaleX: 750 / 902 Total = 0.8314855875831486
scaleY: 375 / 451 Total = 0.8314855875831486
I’ve tried and can not find out why sometimes the script will work and other times it won’t.
Any ideas?
Cheers Jamie
So i figured it out. Maybe i should have thought about this before. All i needed was to run the code one the image had fully loaded. .load() did the trick wonderful. After 2 days of tearing your code apart it was this simple
Again thanks for the script.