GD - Getting width of image resource in memory?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Garrett Albright

    GD - Getting width of image resource in memory?

    I'm searching through PHP's GD functions , and, unless I'm totally
    blind, I can't find a function that will calculate the size of a GD
    image in memory; only getimagesize() , which only works with images on
    disk.

    I have some images that are imagerotate()'d by arbitrary amounts, and
    this causes them to be resized. I'd like to know how wide those images
    are after they are rotated. I suppose I could write some function that
    figures it out based on the degree of rotation, but since I suck at such
    math, I'd rather not. Writing the image to disk and then using
    getimagesize() would be even worse... Is there a simpler way to just get
    the width of an image resource?
  • Andy Hassall

    #2
    Re: GD - Getting width of image resource in memory?

    On Sun, 22 Feb 2004 20:32:51 GMT, Garrett Albright
    <g_m_albr-nospam-ight@ya-nospam-hoo.com> wrote:
    [color=blue]
    >I'm searching through PHP's GD functions , and, unless I'm totally
    >blind, I can't find a function that will calculate the size of a GD
    >image in memory; only getimagesize() , which only works with images on
    >disk.[/color]

    imagesx, imagesy.

    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

    Comment

    • Garrett Albright

      #3
      Re: GD - Getting width of image resource in memory?

      In article <blei30h9u4oq5m pteg89ljq24mdqg sicbp@4ax.com>,
      Andy Hassall <andy@andyh.co. uk> wrote:[color=blue]
      > imagesx, imagesy.[/color]

      Thank you. Sure enough, in my perusal of the documentation, I had
      overlooked those completely non-descriptive functions. :)

      Comment

      Working...