Rotate an image?

Discussion in 'HTML' started by Martin, Sep 23, 2004.

  1. Martin

    Martin Guest

    Is it possible to display an image (a .gif or a .jpg or a .png) such
    that it is rotated some specified number of degrees? Or does the image
    itself have to be modified?
     
    Martin, Sep 23, 2004
    #1
    1. Advertising

  2. Martin

    Dylan Parry Guest

    Spake Martin unto thee:

    > Is it possible to display an image (a .gif or a .jpg or a .png) such
    > that it is rotated some specified number of degrees? Or does the image
    > itself have to be modified?


    With HTML, no. You could do it with some server side programming, but it
    would be easier to do it yourself using your favourite image editor.

    --
    Dylan Parry
    http://webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Sep 23, 2004
    #2
    1. Advertising

  3. Martin

    Martin Guest

    On Thu, 23 Sep 2004 14:16:42 +0100, Dylan Parry
    <> wrote:

    >> Is it possible to display an image (a .gif or a .jpg or a .png) such
    >> that it is rotated some specified number of degrees? Or does the image
    >> itself have to be modified?

    >
    >With HTML, no. You could do it with some server side programming, but it
    >would be easier to do it yourself using your favourite image editor.


    Actually, some server-side programming is already being used in the
    situation I'm taking about. The page in question here is being
    generated by a PHP script. But, the only way I can see to rotate the
    image is by actually modifying the image - and I'm having some
    problems with that. Thus, my question.

    Do I understand you to mean that with some server-side programming the
    image could be displayed at an angle without actually modifying the
    image?
     
    Martin, Sep 23, 2004
    #3
  4. Martin

    Dylan Parry Guest

    Spake Martin unto thee:

    > Do I understand you to mean that with some server-side programming the
    > image could be displayed at an angle without actually modifying the
    > image?


    Yes, although I've not done what you want specifically, it is possible for
    PHP to send back an image header (eg. image/jpeg) and open up an existing
    image to base its content on. You should be able to find some tutorials
    showing how to do this.

    In order to use the image you would simply refer to the PHP file in the
    image element (eg. <img src="image.php" ... />). You could then pass
    variables to the PHP to specify the angle of rotation and the actual base
    image to use.

    Again, I couldn't tell you the exact code to use as I haven't done this
    before, but a search should find you enough info to get started. Of
    course, as I said earlier, it might be less hassle to do it manually ;)

    --
    Dylan Parry
    http://webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Sep 23, 2004
    #4
  5. Martin

    SpaceGirl Guest

    Martin wrote:
    > Is it possible to display an image (a .gif or a .jpg or a .png) such
    > that it is rotated some specified number of degrees? Or does the image
    > itself have to be modified?


    Yes. Stick it in Flash :) You have complete programmatic control over
    every property of the image then.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Sep 23, 2004
    #5
  6. Martin

    Dylan Parry Guest

    Spake SpaceGirl unto thee:

    > Yes. Stick it in Flash :) You have complete programmatic control over
    > every property of the image then.


    So you are suggesting the OP change from using a file type that every
    graphical browser can display without having any external plugin, to using
    a format that is proprietary and won't work in any browser without a
    plugin? :\

    --
    Dylan Parry
    http://webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Sep 23, 2004
    #6
  7. Martin

    Martin Guest

    On Thu, 23 Sep 2004 14:44:39 +0100, Dylan Parry
    <> wrote:

    >Spake Martin unto thee:
    >
    >> Do I understand you to mean that with some server-side programming the
    >> image could be displayed at an angle without actually modifying the
    >> image?

    >
    >Yes, although I've not done what you want specifically, it is possible for
    >PHP to send back an image header (eg. image/jpeg) and open up an existing
    >image to base its content on. You should be able to find some tutorials
    >showing how to do this.
    >
    >In order to use the image you would simply refer to the PHP file in the
    >image element (eg. <img src="image.php" ... />). You could then pass
    >variables to the PHP to specify the angle of rotation and the actual base
    >image to use.
    >
    >Again, I couldn't tell you the exact code to use as I haven't done this
    >before, but a search should find you enough info to get started. Of
    >course, as I said earlier, it might be less hassle to do it manually ;)



    Thanks for the tip - I'll see what I can find out.
     
    Martin, Sep 23, 2004
    #7
  8. Martin

    SpaceGirl Guest

    Dylan Parry wrote:
    > Spake SpaceGirl unto thee:
    >
    >
    >>Yes. Stick it in Flash :) You have complete programmatic control over
    >>every property of the image then.

    >
    >
    > So you are suggesting the OP change from using a file type that every
    > graphical browser can display without having any external plugin, to using
    > a format that is proprietary and won't work in any browser without a
    > plugin? :\
    >


    No... I was just offering one solution. 90% of machines have Flash
    installed (probably as many people who have JS enabled) so it was a fair
    suggestion :)

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Sep 23, 2004
    #8
  9. Martin

    Default User Guest

    Dylan Parry wrote:

    [image rotation with PHP]

    > Again, I couldn't tell you the exact code to use as I haven't done
    > this before, but a search should find you enough info to get started.
    > Of course, as I said earlier, it might be less hassle to do it
    > manually ;)


    I'd recommend the newsgroup comp.lang.php for heavy-duty questions.



    Brian
     
    Default User, Sep 23, 2004
    #9
  10. Martin

    Martin Guest

    On Thu, 23 Sep 2004 16:02:43 GMT, "Default User"
    <> wrote:

    >
    >I'd recommend the newsgroup comp.lang.php for heavy-duty questions.


    Yeah - actually, I've already posted a question there about the
    problems I'm having with the "imagerotate" function (which led me to
    seeing if there was another way to do this).

    I've been googling for the last couple of hours but haven't come up
    with much. :(
     
    Martin, Sep 23, 2004
    #10
  11. Martin

    Jim Higson Guest

    Martin wrote:

    > Is it possible to display an image (a .gif or a .jpg or a .png) such
    > that it is rotated some specified number of degrees? Or does the image
    > itself have to be modified?


    Will you require the image to be rotated via user input, or do you already
    know which angles it will be drawn at so you can provide pre-roated images?

    You could create a load of pre-rotated images (360 of them, say) using PHP
    scripting for the GIMP, then send the user the one they want when the page
    loads.
     
    Jim Higson, Sep 23, 2004
    #11
  12. Martin

    WebcastMaker Guest

    In article <>,
    says...

    > > Yes. Stick it in Flash :) You have complete programmatic control over
    > > every property of the image then.

    >
    > So you are suggesting the OP change from using a file type that every
    > graphical browser can display without having any external plugin, to using
    > a format that is proprietary and won't work in any browser without a
    > plugin? :\


    Uh, yea... (flopping my head back and forth), that is a viable option.
    And if the op's need is for real time image manipulation, then yes,
    Flash is not only an option, it is probably the BEST option.
    --
    WebcastMaker
    Webcasting for free
    http://www.webentations.com
    http://www.webcastmaker.com (CBT)
     
    WebcastMaker, Sep 23, 2004
    #12
  13. Martin

    Martin Guest

    On Thu, 23 Sep 2004 19:58:18 +0100, Jim Higson <> wrote:

    >Martin wrote:
    >
    >> Is it possible to display an image (a .gif or a .jpg or a .png) such
    >> that it is rotated some specified number of degrees? Or does the image
    >> itself have to be modified?

    >
    >Will you require the image to be rotated via user input, or do you already
    >know which angles it will be drawn at so you can provide pre-roated images?
    >
    >You could create a load of pre-rotated images (360 of them, say) using PHP
    >scripting for the GIMP, then send the user the one they want when the page
    >loads.


    No, user input is not a factor. In afct, a series of pre-rotated
    images is exactly what I had in mind.

    I thought I could use the "gd" functions in PHP to create them (I
    don't need anywhere near 360 of them - maybe 6 - 8), but I have not
    been able to get past a couple of problems with the "imagerotate"
    function. But, even if I would get that to work, I'll still have to
    deal with the fact that a rotated image will be much larger than what
    I would like.

    The image I want to rotate is simply a long, narrow rectangle (roughly
    the proportions of a pen or a pencil). When it's displayed on the web
    page, it needs to be clickable - thus my desire to display it as an
    <img>. If I create an image with the narrow rectangle rotated then the
    entire image becomes relatively large (eg: a 2" x .25" rectangle, when
    rotated at 45 degrees, would require an area more than 2" x 2") and
    the background area is also clickable (even though it would be
    transparent). That all led to my original question here about how I
    might rotate the long, narrow image without actually changing it in
    any manner.

    FWIW, I can do exactly what I'm talking about with VML (Vector Markup
    Language) but that works only in IE and I want something that can be
    viewed in any browser. (And, alluding to another branch of this thread
    - without any plug-ins).

    Any other thoughts or suggestions will be greatly appreciated - I'm
    pretty much stumped as to how to do this.
     
    Martin, Sep 23, 2004
    #13
  14. Martin

    Sam Hughes Guest

    SpaceGirl <> wrote in
    news::


    > 90% of machines have Flash installed


    The number is probably much higher.


    Maybe twice as high ;-)
     
    Sam Hughes, Sep 24, 2004
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Showjumper

    How to rotate image upon upload?

    Showjumper, Feb 13, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    646
    Showjumper
    Feb 16, 2004
  2. =?Utf-8?B?QUNhdW50ZXI=?=

    Rotate ASP:Image 45 Degrees

    =?Utf-8?B?QUNhdW50ZXI=?=, Mar 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    5,542
    Steve C. Orr [MVP, MCSD]
    Mar 2, 2005
  3. byrd48

    Photo Rotate Image Cached

    byrd48, Oct 30, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    496
    Eliyahu Goldin
    Oct 31, 2005
  4. RC
    Replies:
    1
    Views:
    944
    Bjoern Hoehrmann
    Aug 3, 2006
  5. IanJSparks
    Replies:
    0
    Views:
    1,226
    IanJSparks
    Jan 10, 2008
Loading...

Share This Page