Results 1 to 6 of 6

Thread: Help a programmer - Finding an image size - HTML, Coldfusion, javascript

  1. #1
    Join Date
    20th April 2003 - 08:28
    Bike
    Something red and quick
    Location
    Auckland
    Posts
    2,499

    Help a programmer - Finding an image size - HTML, Coldfusion, javascript

    Help me....I'm stuck.
    I have a utility that allows users to upload 5 images and a page that should display the image horizontally, scaled to either maximum width 100 or maximum height 100.

    However, I CANNOT FIND THE BLOODY IMAGE SIZE FROM THE FILE.

    I program mostly using Coldfusion, and my host server banned the use of CFFILE ACTION=READ for security reason

    Anyone has any method that can help me? I'll give you 2 green blings.....that's all I can give
    Elite Fight Club - Proudly promoting common sense and safe riding since 2024
    http://1199s.wordpress.com

  2. #2
    Join Date
    3rd July 2005 - 22:03
    Bike
    2005 ZX6R
    Location
    New Zealandish
    Posts
    336
    cfif val(cgi.content_length)

    will give the total data size...


    meh misread the post. I dont really do cold fusion

  3. #3
    Join Date
    20th April 2003 - 08:28
    Bike
    Something red and quick
    Location
    Auckland
    Posts
    2,499
    Thanks, but I need the image width&height, not the filesize.

    Users can only upload jpg and gif.
    Elite Fight Club - Proudly promoting common sense and safe riding since 2024
    http://1199s.wordpress.com

  4. #4
    Join Date
    3rd July 2005 - 22:03
    Bike
    2005 ZX6R
    Location
    New Zealandish
    Posts
    336
    ok from a quick surf I don't think cf actually loads images into memory as a image structure, it handles them simply as standard files so you need some code to find the values with low level file access.

    gif and jpeg are read here:
    http://groups.google.com/group/alt.c...e=UTF-8&rnum=8

  5. #5
    Join Date
    3rd July 2005 - 22:03
    Bike
    2005 ZX6R
    Location
    New Zealandish
    Posts
    336
    ok cf has to be one of the most inefficient imperitive languages on the planet.

    couldn't they group code in &lt?cf tags or something like php?

  6. #6
    Join Date
    20th April 2003 - 08:28
    Bike
    Something red and quick
    Location
    Auckland
    Posts
    2,499
    Oh gees....that was hard work...took me entire day to figure out.

    Anyway, thanks for helping.
    After begging to the server admin, they somehow allow my cffile.

    So I read the entire jpeg/gif file into 1 variable and parse it and did this and that and it worked.

    I've got the code if anyone is interested or need it at some point.

    Cheers guys
    Elite Fight Club - Proudly promoting common sense and safe riding since 2024
    http://1199s.wordpress.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •