开发者

Resizing, cropping, rotating and adding text to images in rails

I need to include a feature on an app I'm building that allows the user to upload an image and manipulate it in various ways including adding text. This is basically a way to design custom printed merchandise as is already found on many websites and will be overlayed on a background image of whatever is be开发者_如何转开发ing customised e.g. T-Shirt.

The basic requirements are: resize, crop and rotate image against background. Overlay and change position/colour/style of text against image. Preview the final design against the background.

I know that flash is possibly the best solution but I was really hoping to avoid it and use Jquery instead. While there is plenty out there for resizing and cropping images with javascript there doesn't seem to be anything that fits my needs.

Does anyone have any ideas?

Thanks,

Tom


Convert, Edit, And Compose Images

I am talking about ImageMagick

http://www.imagemagick.org/script/index.php

Also there is great paperclip gem for working with images. You can make your own processors to do magick.

https://github.com/thoughtbot/paperclip

That's about server side.

Here is something to go with jQuery:

http://shinylittlething.com/2009/02/20/image-manipulation-jquery-plugins/

and this plugin

http://www.gastonrobledo.com.ar/cropzoom/index.html


This is the sort of thing flash/actionscript/flex is made for on client side.
You also might look into HTML5 for the client side.

You can add more functionality if you add server side scripting into the process and use a library like ImageMagik


For cropping, the processor is described here:

http://railscasts.com/episodes/182-cropping-images

You could get inspiration for the rotation as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜