okay guys im using php 4.3.8 witch is bundled with gd2 lib running with apach1.3
i am really in need of some help.......i am using a template with php and i am trying to have a function or some sort of code rotate an image from a button through my template and then submitting my rotated image on my page....any ideas?

    i was hoping to talk to someone that is doing or has done something of kinda what im doing im having alot of trouble using a button to call a rotate function through my template.

      You cant call a php function for a button?

      you can request a script which is then processed and exectuted.

      just make the button call a script called rotatecw.php (clockwise) and have another button for rotateccw.php (counter clock wise)

        that helped alot i see what your saying

          Or you could post a form back to the same page you're on and do the processing there...you don't necessarily need to call an external script to do the work.

            could you give me a simple example of some sort?

              cuz i want to rotate an image thats in a small album one by one

                toddjr wrote:

                could you give me a simple example of some sort?

                Give me some details about how you store information about your images, and I can give you an example of how I'd attack it. imagerotate() works on an image resource, so you'll need to know the full path of the image on the server as well as the mime type so you can (...in the case of a jpeg...) call imagecreatefromjpeg() on the image to get a resource, rotate with the imagerotate() function, and then write the image resource to file with imagejpeg(). IMO, the best way to get the mime type of the image is not through the extension on the file name but with the getimagesize() function. Let me know if you have any questions.

                  okay basically i have a photo album written in php....now i have multiple images per page then i have a high res option when you click the thumbnail and a screen pops (by the way i just started this in the middle of it being done so i will explain the best i can)now i have a database storing the images and there is a next button and previous....though i call the variables and store them into a template array so that they can be called from .tpl file so basically i am trying to create a form button of sort to i guess like you said to request another script rotate the send back the rotated image them refresh to show the new image of the one i was currently on...
                  i hope that helps alitttle i know i am trying to get the hang of all this and its hard cuz i diddnt start on it im thrown into it.....thank you for helping me out

                    toddjr wrote:

                    okay basically i have a photo album written in php....now i have multiple images per page then i have a high res option when you click the thumbnail and a screen pops (by the way i just started this in the middle of it being done so i will explain the best i can)now i have a database storing the images and there is a next button and previous....though i call the variables and store them into a template array so that they can be called from .tpl file so basically i am trying to create a form button of sort to i guess like you said to request another script rotate the send back the rotated image them refresh to show the new image of the one i was currently on...
                    i hope that helps alitttle i know i am trying to get the hang of all this and its hard cuz i diddnt start on it im thrown into it.....thank you for helping me out

                    Well, here's one way to do it.

                    I would have an html form that would post the id of the image I wanted to rotate, and optionally the angle at which to rotate if you support a variable angle. Since php recognizes posted form data as the $_POST array, you can test for the presence of a post variable and valid data and call a function that performs your rotate functionality on the same page that the images are displayed on (if the variable isn't present, it will skip this step and simply display the array of images). And since there's a decent amount of code that goes into the rotation process, I would definitely recommend NOT writing the function as inline code (either in a class or a module).

                      Write a Reply...