CodeIgniter - is there a GUI based library for cropping an image? - php

CodeIgniter - is there a GUI based library for cropping an image?
I want to select exactly what and where to crop. Ideally I want to be able to go to
mysite.com/manageImage/crop/example-image.jpg
and it would show the interface to crop it, then crop that image.

What you need to do is fine a good library then add it as a library in your CI structure. Then the manageimage controller's crop function will take image name as argument and invoke the cropping library to do its magic. Most of what you will need, since it comes with UI will mean that you need to have some integration effort.
Sadly cannot google and list libraries for you, but I hope you got an idea what direction to proceed.
One good lib that comes to mind is cropzoom

Related

How to create Image with custom text in php?

I am looking to create a Product customization tool in PHP. This tool will allow the user to create his own Customization to a predefined Mobile cover. I already have a Mobile cover image and I am looking to allow a user to write 3 characters which will be written in a circle called as monogram with a background color.
I am not sure how to proceed ahead with it. I am looking to dynamically create image that is placed on the Mobile cover in such way that it looks its part.
here is the link to a sample image which would be generated
http://d13eowy7ljcd3.cloudfront.net/images/ark.png
I am looking for way on how to approach it and which php image handling libraries should I make use of.
I think you should use ImageMagick: http://php.net/manual/en/book.imagick.php This need that imagemagick was installed on the system, If you do not have a dedicated server you could try with GD http://es1.php.net/manual/en/book.image.php, but I think that imagemagick is more powerfull.

Suggest a good image upload-and-crop tool

I'd like to know which up-and-crop tools you suggest to me. I tried couple of scripts like JCrop but I always get stack with some type of format like bmp. I either can't upload or I can upload but can't crop. If you use (or know) one that works well with different formats, then please just give me its name and I'll be strongly appreciated!
Well, i dont know much about JCrop but you can build it up with several tools.
I think image processing kind of works should be done on server side.
There is a good OOP Library called Imagine. It's mostly based on Python's Imaging Library which is awesome and has decent documentation. And this is its crop functions documentation.
On client side you can use some kind of image area selection tool to let the user determine desired area to crop. imgAreaSelect is good to go. Then you can send crop area to php by JQuery's post function or any other way.
It's amassing that in all this time this haven't got any other answers, I hope this helps.
Like stated in the other answer you should combine a few tools to solve each part of the problem.
To let the user select the cropping area:
If you don't like jCrop you can try Guillotine. It's very lightweight, easy to set up and allows to crop, zoom and rotate images. It has touch support and it's responsive (fluid).
Keep in mind that you can't display image types that the browser doesn't support, but you can convert them in step 3.
To upload the images:
For most cases, once you have the cropping area, with a simple file input will suffice.
Now, if you want to upload files asynchronously check out
this
for a quick and easy set up or this
for a more complex solution.
To actually crop and process the image:
Once uploaded you can crop, convert and process the images on the server, ImageMagick is a great tool for this. It's Open Source and many languages have wrappers for it.
You've tagged the question with PHP so here is a PHP wrapper for ImageMagick.

Any Javascript or PHP libraries or tutorials for making an image out of a page?

I'm wondering if there are any existing (ideally well documented) PHP or Javascript/jQuery libraries/plugins or tutorials for creating an image from a page. An example of this in existance is Zurb's BounceApp.
This probably isn't something that's oft used, however I'd love to incorporate this into a personal project of mine.
In my particular use case, I would have the CSS and HTML which would dictate the "image" available locally, so there would be no need to get the HTML mark-up of another page, then find it's CSS styles.
Any advice or pointers towards a helpful tutorial or plugin/extension would be very, very, very appreciated :).
You should check html2canvas, it the newest solution for your needs.
You should check this implementation: http://hertzen.com/experiments/jsfeedback/
To crop the image, you can use JCrop and send the info to a PHP script, to resize / crop the image the way you want.
Hope that helps!

In CakePHP, whats the best Image Upload / Resizing component you've used?

Im looking for somthing that can belong to many many models and, hopfully, has all the resizing functionality built in too.
Wondering if there's any good suggestions out there, I don't want to pick the wrong one.
Or is it just worth building my own?
I wrote a pretty sweet image upload component a few years ago for Cake 1. I don't have a clue where the code is these days, but my friend Koa did a write up on it a while back:
http://labs.iamkoa.net/2007/10/23/image-upload-component-cakephp/
http://labs.iamkoa.net/2007/11/06/multiple-image-uploads-into-single-mysql-table-cakephp/
Might be something you can hack. It handles uploads, resizing (resize, crop, resize then crop, max, mix) and if I remember correctly, it might even do filters (flipping, inverse, greyscale).
I also ported the code to Zend framework (and PEAR file naming) for my new content management framework. It's all contained and much better now (does all the things I mentioned above and is pretty well documented). You can download that here (check out the ImageManipulator class. I think the FileUploader class has a dependency on my String utils class which you could easily remove if you want to use that.
Otherwise, I say roll your own. The component architecture in Cake was confusing to me at first so it could be a good learning XP if you don't know it yet. If you do, you can just grab someones uploader and convert it into a component for your Cake application.
Check out the Media plugin by #nperson https://github.com/davidpersson/media/wiki
https://thoughtwm.com/code/ for the image upload
&
http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/ for the image resizing
How about for getting EXIF/Meta info of the image?

Merging two Images with CodeIgniter Image Manipulation Class

I am developing a new project in CodeIgniter (CI), and would like to find a CI solution to this current issue. I've got one image, which resembles a picture frame. I would like for uploaded images to be modified to have this frame in their background.
Example:
alt text http://www.sampsonresume.com/projects/visit-creation/vc-process.jpg
The first picture is the frame. The second is the uploaded image (after resizing/cropping), and the third is the combination of both, which I would like to accomplish.
If the images are going to be shown on your own website, it would probably be easier to simply use CSS (especially if your bottom image simply gives a border...). Of course, if you want people to be downloading these files with the frame, that's a different story.
I don't think CI has a built in method in the Image Manipulation class. But, that class is simply abstracts typically-used features from one of the three major PHP image libraries (GD, ImageMagick, and NetPBM). If you know what library you are using (I normally use GD for basic things like this...), then you'll just have to use their proprietary ways of doing this stuff.
You can even make your own library or extend the Image Manipulation class to add your own special features.
Also, there may be ways to do this in Zend (not sure, I'm not going to look it up either). But, there are easy ways to include Zend components into CI if you do find something.
Good luck man!
Agreed with Kyle -- your best bet is to extend the libraries already there. Take a look at ImageMagick "composite" command.
composite -gravity center smile.gif rose: rose-over.png
http://www.imagemagick.org/script/composite.php

Categories