Jump to content

[SOLVED] Uploading images and working with them???


gsaldutti

Recommended Posts

I'm not asking for anyone to write any code, I just want some general input. I want to create a website where users can upload photographs and scale them within a specified space and also add some basic text within that space (either on the picture itself or under it, like a caption). And I'd like them to be able to choose from some basic font colors and styles, but nothing crazy.

 

So they'd essentially click "browse," find an image on their computer and hit "upload" and then the image would appear in a specified "work area" where they could scale it and add text.  Essentially a simple WYSIWYG editor.

 

Then I want that the finished photo/text (arranged exactly how the user arranged them within the confined space) to be uploaded to my server so that I can then display/print it out looking exactly how they arranged it.

 

Any thoughts on if this type of thing can be done strictly with PHP/MySql (which I have a basic knowledge of) or do I need to implement some other programming languages to make this happen?

 

Also, when it gets to the point where the user uploads the finished product to my server (which would just be an image file containing the photo and some text), do you recommend having the images upload into a MySql database, or should I handle them as just separate individual files in a specified folder on my server? (I've heard that storing images in MySQL is not always the best method, but I don't know if that's accurate).

 

My guess is that the part where the user can scale/move the image in the confined space and add text is probably the hardest part and might not be doable with PHP alone.  But I really don't know

 

Anyway, any input/info/advice/suggestions would be greatly appreciated.

 

Thanks!

 

PHP is server side, you would have to use flash, java, or javascript for this (at least the image manipulation part). But yes, for storage you would want to avoid storing the images in a database, it's much better to use separate files.

It won't really be like a WYSIWUG editor, but GD can help you...

 

imagecopyresized(); or imagecopyresized(); can help you resize.

 

imagestring(); can help you write text on the image.

 

Make sure you visit the PHP manual and read about the functions. They have helpful sample code.

For wysiwyg image manipulation, I've used jcrop (jquery extension) as an avatar manipulator before. Obviously it's javascript, not php, but I used a php back-side, see the GD functions above for more information on php image manipulation, but I'd suggest using imagecopyresampled() not imagecopyresized().

 

http://deepliquid.com/content/Jcrop.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.