Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts

    imagecreatefromjpeg failing

    I've read a zillion quesitons and comments regarding problems with imagecreatefromjpeg(), mostly instances where it was running out of memory. Upping "memory_limit" from php.ini fixed most of the problems I read about.

    In my case imagecreatefromjpeg (or @ImageCreateFromJpeg) don't appear to return at all when I pass it a 4 megabyte file (it works on smaller files (exactly how much smaller, I'm not sure of at the moment - at least 1meg).

    I've set memory_limit, post_max_size, and upload_max_filesize real high. The file passed to imagecreatfromjpeg is first uploaded, and the 4meg+ files do that just fine. The problem is when I hit imagecreatefromjpeg.

    Any help is most appreciated.

    BTW, it works fine on my local machine, but not on my host's server.
    Last edited by snoodle; 05-06-2009 at 10:59 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Remove the mutor from it and either display you're errors or review you're error log (go for the log). Post the error message that provides.
    Without knowing the error, my initial assumptions are either that a) you're host doesn't support this function, or b) you're host cannot open the file specified.
    The error will tell you what it is.

    Edit:
    I missed the part about the 1mb files being ok.
    Post the error anyway.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks for the advice. After a bunch of trial and error adjustments, I got it working, and I am embarrassed to say, I have no idea what I did (so I would imagine it was something in my code - though why it was working fine on smaller files, and why larger files worked on my machine, I have no idea).

    I will have that debugging log active next time. Thanks for the advice. I'll remove the, umm, mutor(?) from it.


  •  

    Posting Permissions

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