Jump to content


Photo

Strange behavior


  • Please log in to reply
2 replies to this topic

#1 akop

akop
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 September 2006 - 06:54 PM

Hello dear freaks!

The script in question works with GD library and what it is doing normally is creating several copies of original image that was submitted via form.

Like this:
$img->set_size(150, 150, "-");
$img1->set_size(550, 550, "-");
$img2->set_size("2250", "2250", "-");
$img2->set_size("1500", "1500", "-");

and some other sizes.

Everything worked perfectly with my old provider but with the new provider problems started:

Now it stops somewhere in the middle without any warnings or mistakes. Looks like this:

Creating Database record...     Done
Creating Thumbnails...    Done
Creating an intermediate size inamges...    Done
Creating watermark...    Done
Creating an origanal size previews...    Done
Creating Cover size version...    Done
Creating Double size version...    Done
Creating 2250 x 1490 px version...    Done
Creating 1500 x 1000 px version...

Now the page finished loading like if the program has reached it's end. But it did not. I’m sure that the code is fine – I tested it on three other servers and it worked perfect there.

max_execution_time is set to 150, all other php settings look fine at least for me.  Anyway, here is the link to phpinfo page: http://www.photo-tra....net/phpini.php

So the question is what might actually be the problem there?

I also need to mention that the provider is very careful about security aka its own safety: there are a lot’s of restrictions when it comes to server configuration. The only thing I managed to change is put php.ini in the root folder with increased max_execution_time but it didn’t help  :(.

???

Thank you for any suggestions!
Alex

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 September 2006 - 07:02 PM

Your best bet as it worked fine, is to get the old php.ini that did work, and try to configure the new php.ini to the old one match them up and see the diffrence.

good luck.

apart from that you have to let us see the code ok.

dont forget that php version differ for programming example if you use an old php version thenn you get a new version your need to use the $_GET or $_POST statement.

anyway good luck m8


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 akop

akop
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 September 2006 - 07:24 PM

hi redarrow,

here is the code without classes please check it first. With red I marked the place where it stops. As you can see the parts of the program that has been done immediately before are exactly of the same nature that means that is they are OK, the next one should be OK as well. And I also tried to change the order of them which didn’t help: the program now stops after the same period of time but during other resampling.

    // Creating thumbnails
    print "<b>Creating Thumbnails...</b>";
    $img = new ss_image($orig_img, "f");
    $img->set_size(150, 150, "-");
    $new_name = $reference;
    $img->output($where="../photos/preview_small/".$new_name, $what="c", $method="JPG");
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Creating intermediate size preview
    print "<b>Creating an intermediate size inamges...</b>";
    $img1 = new ss_image($orig_img, "f");
    $img1->set_size(550, 550, "-");
    $img1->commit();
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Watermark for intermediate size image
    print "<b>Creating watermark...</b>";
    $img1->watermark("../images/watermark_small.gif", $transparency=20, $x=20, $y=20, $makegray=true, $src_kind="f", $desired_w="*",$desired_h="*");
    $img1->output($where="../photos/preview_big/".$new_name, $what="c", $method="JPG");
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Creating preview with original size and watermarks
    print "<b>Creating an origanal size previews...</b>";
    $img2 = new ss_image($orig_img, "f");
    $img2->set_size("*", "*");
    $img2->commit();
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Watermark for original size previews
    $img2->watermark("../images/watermark.gif", $transparency=20, $x=20, $y=20, $makegray=true, $src_kind="f", $desired_w="*",$desired_h="*");
    $img2->output($where="../photos/preview_orig_size/".$new_name, $what="c", $method="JPG");

    // Creating cover and double versions
$path = "../photos/cover/".$new_name;
    print "<b>Creating Cover size version...</b>";
    if(!copy($orig_img, $path))
    {
        print "Couldn't copy the cover size file...";
    }
    else
    {
        print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";
    }

print "<b>Creating Double size version...</b>";
$path = "../photos/double/".$new_name;
if(!copy($orig_img, $path))
    {
        print "Couldn't copy the double size file...";
    }
    else
    {
        print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";
    }

// Creating 1/2 (2250 x 1490 px) size version
    print "<b>Creating 2250 x 1490 px version...</b>";
    $img2 = new ss_image($orig_img, "f");
    $img2->set_size("2250", "2250", "-");
    $img2->output($where="../photos/size_2250/".$new_name, $what="c", $method="JPG");
    $img2->commit();
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

// Creating 1/4 (1500 x 1000 px) size version
    print "<b>Creating 1500 x 1000 px version...</b>";  >:(
    $img2 = new ss_image($orig_img, "f");
    $img2->set_size("1500", "1500", "-");
    $img2->output($where="../photos/size_1500/".$new_name, $what="c", $method="JPG");
    $img2->commit();
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Creating 1/8 (750 x 496 px) size version
    print "<b>Creating 750 x 496 px version...</b>";
    $img2 = new ss_image($orig_img, "f");
    $img2->set_size("750", "750", "-");
    $img2->output($where="../photos/size_750/".$new_name, $what="c", $method="JPG");
    $img2->commit();
    print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done</i><br>";

    // Copy original images to a new location
    $path = "../photos/originals/".$new_name;
    print "<b>Coping Original images into new location...</b>";
    if(!copy($orig_img, $path))
    {
        print "Couldn't copy the original file...";
    }
    else
    {
        print "&nbsp;&nbsp;&nbsp;&nbsp;<i>Done:</i>: <b><font color=\"green\" size=\"130%\">".$new_name."</font></b> was inserted<br>";
    }





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users