importing a huge directory of images will cause the first page load of those images (album view) to not load, with php giving a fatal error: 30 second time limit is up.
The reason is the derivative images. The import doesn't create the derivatives, so on the first album view page load, all of the images suddenly need their derivatives created, and so depending on the server's hardware and the number of pictures uploaded into the album, the page may need a few reloads before it will finally show the album. That is to say, it runs out of time more than once while creating all of the thumbnails and previews.
The solution is to create the derivative images during the mass import. See patch. However, the patch still allows derivatives for non-mass-imported images to be created in due time by the image module, because those ones weren't a problem. It was only viewing a whole bunch of brand new images at once that was causing the problem. In other words, only mass imported images are affected by this patch.
note to acidfree project maintainer vmauery: I don't expect this to be merged in. It's really just a special needs issue. I figured I'd submit the patch though because a few others might have found this to be a bit irksome, as I have. And... the patch might be considered by some to be 'hacky'.
Comment | File | Size | Author |
---|---|---|---|
#9 | batchmode.patch | 5.06 KB | mwheinz |
fix_generate_derivatives_at_import_time.patch | 1.59 KB | eddified |
Comments
Comment #1
eddified CreditAttribution: eddified commentedComment #2
eddified CreditAttribution: eddified commentedoops, the last changed line in the diff wasn't supposed to be in there. That is to say, I meant to remove the last change before creating the patch.
Comment #3
eddified CreditAttribution: eddified commented--duplicate comment--
Comment #4
mwheinz CreditAttribution: mwheinz commentedI believe cron.php will also re-generate thumbnails.
Comment #5
mwheinz CreditAttribution: mwheinz commentedNope - need to evaluate how this works in 6.x.
Comment #6
mwheinz CreditAttribution: mwheinz commentedComment #7
mwheinz CreditAttribution: mwheinz commentedNeed to investigate the batch API - that seems to be the correct place to look.
Comment #8
mwheinz CreditAttribution: mwheinz commentedI've experimented with converting Mass Import to use the batch API, but I got stopped dead by the need to support recursive uploads. That part will need more work.
Comment #9
mwheinz CreditAttribution: mwheinz commented