Jump to content


New preview system?


4 replies to this topic

#1 high6

    Young Padawan

  • Members
  • Pip
  • 57 posts

Posted 07 July 2007 - 09:25 AM

Okay well I have been working on this project for awhile and it is almost complete.

The attached source doe you wont really need to help but if you need more of an idea of what I am talking about then its there.

Now what I am trying to do is redo the preview system. Right now it is in php/javascript with php doing most the server thus using loads of bandwidth so what I wanna do is try to make it use the least amount of bandwidth by switching it to client-side. So I was wondering how you manipulate images with javascript or a client-side language.

http://www.zomgstuff...ignsig/sign.php

You can see it there.

The preview system works by javascript changing the image every 2 seconds(if the text is changed) to preview.php with the given arguments then preview.php generates an image.

Attached Files



#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 07 July 2007 - 02:50 PM

Not really.
I have seen some various things done, such as a very nifty reflection, but I doubt you'll find anything as powerful as what you can do with PHP (not that PHP is that powerful compared to Photoshop, lol).

The best you could probably do is some tricks with transparency, and text over an image using a positioned div.
There may be things you could do to reduce bandwidth, such as caching the user's image on the server, but other than that, not really much you can do about it.

#3 high6

    Young Padawan

  • Members
  • Pip
  • 57 posts

Posted 07 July 2007 - 03:57 PM

now 1 more problem I am having is if you check it, the patriot smiley goes from its original yellow to tan. Why is that?

Also couldn't I do it in flash? Might be a bit hard though.

Also is it possible to have a php create 2 images on 1 page?

Edited by high6, 07 July 2007 - 04:00 PM.


#4 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 07 July 2007 - 06:31 PM

I can't answer you're first question, as I've yet to look at your source when I have the time.

You seem to be doing something similar to what I've been working on. Only, I'm creating a full image manipulation tool, with a ton of features, and not just a sig maker (I'm assuming from the title of the attachment). It would be completely possible in Flash, provided you don't have real complex options. You would have to have it save all its actions in a kind of history, and send the final output operations to the PHP script to generate, as Flash cannot save images directly itself.

And no, PHP can only send one image at a time. It can generate more than one, save more than one, but it can only send headers and output one at a time.

#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 07 July 2007 - 11:05 PM

But you could use imagecopy() along with something like imagecreate() and some basic math to output "two" images (catch being it would end up as 1 image, if that matters).

Also, the use of php to make images doesn't really take up that much bandwidth. True, the browser won't cache them and that can hurt. But the big hit comes from server resources. Enough images and enough people accessing them and your server will crawl to a snail's pace quick fast and in a hurry. So storing generated images in a directory somewhere rather than constantly generating them would help significantly (like demon suggested).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users