in reply to Imager: Gateway Timeout

First get your operations right. Then try to optimise. You create $med as a copy and then you overwrite that copy with $img->scale. How about this style: $img->copy()->scale(xpixels=>750)->write(file=>...); I will assume that this will free all memory once done writing to disk. If you intend to parallelise (and your server is able to) then you could create one sub to do all the processing for just one file. Then either call this sub sequentially or in parallel.

Replies are listed 'Best First'.
Re^2: Imager: Gateway Timeout
by cristofayre (Sexton) on Dec 24, 2019 at 12:28 UTC

    Another note: Windows will only allow one thread, so you cannot create childs, (which is what I THINK you mean by in parralell. What I am currently doing is akin to this:

    @dir(Standard, large, xl for loop of @dir process_img(); } sub process_img Create thumbnail and save in appropriate sub folder; Create medium size and save in appropriate sub folder; Rotate image 90 and save in appropriate sub folder; }

    So as well as original, I end up with graphics in thumb, medium and upright folders within each of the three folders above

      Why not create the thumbnail from the medium sized image?

Re^2: Imager: Gateway Timeout
by cristofayre (Sexton) on Dec 24, 2019 at 12:20 UTC
    Thanks for the feedback. I admit, I don't know what i'm doing with program; trial and error trying to snip a bit here and there from the documentation. I made a copy so as not to touch original, and then to scale that copy. But I'll try your suggestion, and see what happens