Author Topic: jQuery Image Crop  (Read 1857 times)

0 Members and 2 Guests are viewing this topic.

Offline wookie

  • Peasant
  • *
  • Posts: 68
  • Cookies: -4
    • View Profile
jQuery Image Crop
« on: March 22, 2013, 11:32:34 pm »
I got bored so I started playing around on JS Fiddle and mimicking cropping an image with  jQuery UI and CSS.  It could actually be turned into proper image cropping with an ajax call and some further fiddling so I may do that if I get even more bored and post a PHP script to handle that, but for now, for those looking for a widget like this for there site, I think it's a neat way of doing it.


You'll probably find plugins all over the show for this kind of thing but it's easy as hell to do and most of them will be overkill for simple usage.


Appreciate feedback and improvement suggestions.


[size=78%]http://jsfiddle.net/tMnHr/[/size]

Offline northernking

  • /dev/null
  • *
  • Posts: 6
  • Cookies: 3
    • View Profile
Re: jQuery Image Crop
« Reply #1 on: April 07, 2013, 11:12:08 pm »
Its nice to see you had the interest in playing with this sort of thing. Even though is quite simple yet, it simulates the end results quite well.


Currently its not usable for a production environment as other scripts, such as jCrop or many others, but you can try to improve it and make a real script.

Offline wookie

  • Peasant
  • *
  • Posts: 68
  • Cookies: -4
    • View Profile
Re: jQuery Image Crop
« Reply #2 on: April 08, 2013, 02:42:40 pm »
Its nice to see you had the interest in playing with this sort of thing. Even though is quite simple yet, it simulates the end results quite well.


Currently its not usable for a production environment as other scripts, such as jCrop or many others, but you can try to improve it and make a real script.


Thanks, wasn't intended to be something that could be used in production, however it is (i think) a good starting point because you can see the jquery identifies all of the co-ordinates and paramaters that php-gd functions will require to do the actual crop server-side.


It's something I'm going to look into setting up soon hopefully so if I get time I'll post a script for it.

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: jQuery Image Crop
« Reply #3 on: April 08, 2013, 11:10:14 pm »

Thanks, wasn't intended to be something that could be used in production, however it is (i think) a good starting point because you can see the jquery identifies all of the co-ordinates and paramaters that php-gd functions will require to do the actual crop server-side.


It's something I'm going to look into setting up soon hopefully so if I get time I'll post a script for it.
It's something good for previewing and lazy projects :D
~Factionwars

Offline sc13nt1st

  • /dev/null
  • *
  • Posts: 12
  • Cookies: 0
    • View Profile
Re: jQuery Image Crop
« Reply #4 on: April 12, 2013, 06:05:39 am »
Nice work! I am just starting to learning Javascript and CSS.