Using the jCrop Plugin

Working with the jCrop Plugin

Feb 9th in Screencasts by Brenley Dueck

jCrop is a fantastic jQuery plugin that allows your users to easily crop their photos to the exact dimensions that they choose. Setting up such a system is easier than you might think. Brenley will show us how!

PG

Author: Brenley Dueck

Hello everyone, I'm Brenley Dueck or better known as Brenelz. I currently run my own business called Brenelz Web Solutions which focuses primary on winnipeg website design and development. The web technologies I most specialize in are CSS, jQuery, AJAX, PHP, and the MySQL database. Please make sure to visit my web development blog and follow me on twitter.

Runner-Up: Brenley Dueck

  • Subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.


Related Posts

Check out some more great tutorials and articles that you might like

Enjoy this Post?

Your vote will help us grow this site and provide even more awesomeness

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Gareth February 9th

    Great screencast!If this is an example of the quailty of screencasts to follow I am very excited!

    ( Reply )
  2. PG

    insic February 9th

    as expected. this tutorial is awesome.

    ( Reply )
  3. PG

    Patrik February 9th

    Broken link on the “Demo”.

    ( Reply )
  4. PG

    Javiro February 9th

    It’s nice. It’s similar to MCImageManager of TinyMCE

    ( Reply )
  5. PG

    Miles Johnson February 9th

    I use this plugin and I hae to say it is the most handy and easist plugin to install. I have it flawlessly working with Amazon S3.

    ( Reply )
  6. PG

    Webdesign Groningen February 9th

    Nice tutorial, this could be of great use for my cms.

    ( Reply )
  7. PG

    Saurabh Shah February 9th

    nice tutorial…

    ( Reply )
  8. PG

    Andrew Turner February 9th

    Great Screencast, Nice Work on It. A deserving runner up :)

    One thing for Jeff or another of the NetTuts team, the demo for this isn’t working.

    ( Reply )
  9. PG

    DKumar M. February 9th

    Nice info Brenley… Thanks for sharing !!

    ( Reply )
  10. PG

    M.A.Yoosuf February 9th

    great stuff, more and more jQuery pls

    ( Reply )
  11. PG

    John February 9th

    seems like the source-code belongs to an other tut. could you fix it, please?

    ( Reply )
  12. PG

    Ahmet Alp Balkan February 9th

    “demo” link is broken please check.

    ( Reply )
  13. PG

    Sanne February 9th

    Great tutorial!
    Definitely gonna use this in my new project :)

    ( Reply )
  14. PG

    Devin February 9th

    Very nice tutorial!

    ( Reply )
  15. PG

    Muneef February 9th

    Nice tut
    btw has any one used Aptana IDE ?, just curious

    ( Reply )
  16. PG

    Texo February 9th

    Please fix demo link

    ( Reply )
  17. PG

    rachid February 9th

    Nice tuts !!

    ( Reply )
  18. PG

    Kristien February 9th

    I get this error when I try and view the live demo..

    “AccessDeniedAccess Denied510BA3D30E0F655DArm3v6GRs7c8H9ZLmnTZdl5iUFu4kHfxro4pvUAXBwNj4c07TGq8pm2S3yW5S42e”

    ( Reply )
  19. PG

    Blaž February 9th

    Same for me, demo broken. Nice tutorial

    ( Reply )
  20. PG

    Jeffrey Way February 9th

    Sorry about the demo. Brenley, please email the demo that you used.

    ( Reply )
  21. PG

    windir February 9th

    Nice tut! :) I’ll probably use this in a currently ongoing project :)

    I also need to place a logo on top of the image, and i need to drag and drop the logo to place it to fit.

    Anyone know a way to do it? A jquery plugin who can do this natively or something?

    ( Reply )
  22. PG

    Shane Sponagle February 9th

    Nice tutorial. I can definitely see the potential with this plugin. Thanks :)

    ( Reply )
  23. PG

    Brenelz February 9th

    @Jeff

    I emailed it to you yesterday afternoon, but I guess didn’t get through? I tryed again so let me know that you received it

    ( Reply )
  24. PG

    Brenelz February 9th

    For those of you that want a live demo, you can check it out here for now:

    http://www.brenelz.com/jcropdemo/

    ( Reply )
  25. PG

    Kevin Martin February 9th

    @Brenelz, nice tut. I have this plugin installed on a project I’m working on. Really easy to use.

    @Muneef, Aptana IDE is OK, not the best of IDE’s though. It is pretty big and loads a bit slow. If you’re a beginner, Aptana is the way to go, but I just use notepad++ since it faster and doesn’t have anything more than I need.

    ( Reply )
  26. PG

    Brenelz February 9th

    Aptana definately requires a ton of resources, but at times can be handy as it compiles your code as you type it similar to Eclipse so syntax errors are caught instantly…

    ( Reply )
  27. PG

    Philsbury February 9th

    I’ve used something similar before and found that I needed to chmod the images to 777 straight after saving otherwise their ‘owner’ is php/apache and can’t be changed, might be one to keep in mind.

    ( Reply )
  28. PG

    Madger Badger February 9th

    Insic looks hot!! :p

    ( Reply )
  29. PG

    trs21219 February 9th

    nice tutorial here. ill be using it on a site im working on right now with codeigniter. thanks!

    ( Reply )
  30. PG

    Jack February 9th

    Cool screencast Brenley, jCrop, I like it a lot :)

    I think the source files have been mixed up with another screencast.

    Anyone else notice this?

    ( Reply )
  31. PG

    Brenelz February 9th

    @Philsbury I think I briefly mention in there that the images will need to be chmoded to work on the server. In my example I was just using a local server so it didn’t matter

    @Jack yes… the source and demo files have not yet been posed – http://www.brenelz.com/jcropdemo

    ( Reply )
  32. PG

    Leon February 9th

    Source code link is broken, fix please.
    The video tutorial is awesome though!

    ( Reply )
  33. PG

    Jack February 9th

    @Brenelz looks like it’s all setup now.

    Great work on the screencast!

    Cheers.
    -Jack

    ( Reply )
  34. PG

    Thomas Milburn February 9th

    Well done Brenelz a brilliant screencast! I can see this plugin having many uses in different projects.

    I would warn that this code shouldn’t be used live on the internet “as is” because it does contain some security vulnerabilities. For example the filename isn’t sanitized leading to xss vulnerabilities and the script doesn’t check filenames or paths are valid when opening files leading to much more serious vulnerabilities. There are quite a few modifications I would make to your code if anyone is interested I can email the changes to them.

    ( Reply )
  35. PG

    Brenelz February 9th

    @thomas thanks for the compliments! I do realize I didn’t totally lock the code down and kept things as basic as I could as it is already almost a 45 min screencast ;)

    Passing filenames with a get string is always scary ;)

    ( Reply )
  36. PG

    Dani February 9th

    You guys really need to add an iPhone d/l link for times like this; when I’m we are stranded.

    ( Reply )
  37. PG

    João Pedro Pereira February 9th

    Good job.

    ( Reply )
  38. PG

    Navdeep February 9th

    We just released a Drupal module based on this here http://drupal.org/project/avatarcrop

    ( Reply )
  39. PG

    Moksha Solutions February 9th

    good tutorial i hope other too come soon, thanks for it

    ( Reply )
  40. PG

    Brenelz February 9th

    You will see plenty more great screencasts this week! Looking forward to James’ ImgPreview jQuery plugin!!

    ( Reply )
  41. PG

    themisfit February 9th

    nice tutorial, now I have to learn jQuery.

    ( Reply )
  42. PG

    Chris Gunther February 9th

    Great screencast, looks like a powerful plugin.

    ( Reply )
  43. PG

    Melvin Walls February 9th

    Great work! I can’t wait to see all of the other winners

    this is just what i was looking for my current project btw :D

    ( Reply )
  44. PG

    Ariyo February 9th

    SWEET. Thanks a lot.

    ( Reply )
  45. PG

    Shane February 10th

    I think it’s fantastic that a plugin such as this makes it so easy to incorporate advanced functionality in our web apps.

    Good screencast too! :)

    ( Reply )
  46. PG

    Andris February 10th

    Man, that was awesome and exactly what I needed right now. I’m gonna improve my cms with that. Thanx a lot!

    ( Reply )
  47. PG

    Doug February 10th

    The jCrop plugin is a very useful tool. We use it on our website to crop the images to create thumbnails. It has saved us a ton of time.

    I’m sure this tutorial will help beginners out a lot.

    ( Reply )
  48. PG

    shin February 10th

    Is there any way I can add some size options or custom size input?

    ( Reply )
  49. PG

    Chad February 10th

    Looking for a wordpress plugin of this…

    ( Reply )
  50. PG

    Brenelz February 10th

    I am glad you all liked the above screencast. Check out my blog as their will be more great content there as well..

    Thanks Jeffery for this opportunity!

    ( Reply )
  51. PG

    strony internetowe February 11th

    very usefull. nice plugin

    ( Reply )
  52. PG

    Y. Steven February 11th

    Good job in making those video, i really appreciated that, thank you

    ( Reply )
  53. PG

    nignog February 22nd

    Umm!

    ( Reply )
  54. PG

    Josh February 26th

    I do not believe that IE6 recognizes POST values coming from submit buttons. So your if( isset($_POST['submit'])){ … } test you are doing will not work. If you print your post array you will see that in IE6, it is left out of the array. I usually just test if( $_POST ){ … }

    ( Reply )
  55. PG

    Josh February 26th

    In response to my previous post…actually I think that IE6 only fails when you have multiple submit buttons in the same form. For example, if you have a ’submit’ or ‘delete’ option.

    ( Reply )
  56. PG

    ozzy March 10th

    Check out webmotionuk’s cropping plugin

    http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/

    easy to use and to implement into your exisiting code. great learning material too!

    ( Reply )
  57. PG

    Marcel Doornbos March 11th

    Really thanks,
    I’ve now used it in a Clients portfolio site. Now saves the original file after that creates the thumbnail file and writes all information to a database. at the portfolio gallery the thumbnailfile is clickable and openes the original file in a lightbox window. :)

    Thanks :D

    ( Reply )
  58. PG

    Hanky April 14th

    Really nice screencast Brenelz.

    Marcel Doornbos, any chance that you could share your work :D
    Im in need of just what you described you have created for a client.

    TY

    ( Reply )
  59. PG

    Prassanna June 11th

    Thanks a lot. It really helps me in my project.

    ( Reply )
  60. PG

    Chris Cagle October 14th

    For everyone that likes Jcrop, here is a simple tutorial showing you how to get it setup full circle within an application: http://www.cagintranet.com/archive/how-to-use-jcrop-from-within-an-application/

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    October 14th