+ Reply to Thread
Results 1 to 7 of 7

Get Image dimentions before loading? if wrong dimention do not load...

  1. #1
    Registered User
    Join Date
    06-25-2010
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    92

    Get Image dimentions before loading? if wrong dimention do not load...

    How can one get picture dimention before loading ?

    imagine i have 30 pictures that i need to be < 1024x768 or < 768x1024

    kind of cheking out :

    Please Login or Register  to view this content.
    i have try to find the forum but with no sucess..

    thx in advanced
    Last edited by homasa; 08-04-2010 at 12:17 PM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    Something like this (no error checking for file types):
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-25-2010
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    Hello romperstomper, how are you?

    uuuaaauuuu what a great macro, but a bit larger he!he!he!

    well i had to change a bit your script so it can work () :

    Please Login or Register  to view this content.
    Doesn exist anything less complicated ? he!he!he!

    thx very very much for your help

    regards

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    I have another, slightly shorter, function that would return the dimensions as a string (e.g. "800 x 600") but then it's more work to validate the height and width!

  5. #5
    Registered User
    Join Date
    06-25-2010
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    hello again,

    just tested it with a file 768x2010 and it doesnt work...

    its curious, do you know why ? because it should work...

    thx

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    Your test requires the smaller dimension to be greater than 768, not equal to it, for an error.

  7. #7
    Registered User
    Join Date
    06-25-2010
    Location
    Lisbon
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Get Image dimentions before loading? if wrong dimention do not load...

    ok thats been traped using

    Please Login or Register  to view this content.
    nice in deed, good afternoon this day is

    thx very much once more

    regards
    Last edited by homasa; 08-04-2010 at 12:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1