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'.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eddified’s picture

Title: page fails to load--uses up default 30 second time limit after a mass import (esp. using "Import local files") » after a mass import page fails to load--uses up default 30 second time limit (esp. using the "Import local files" method)
eddified’s picture

oops, 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.

eddified’s picture

--duplicate comment--

mwheinz’s picture

Status: Needs review » Closed (won't fix)

I believe cron.php will also re-generate thumbnails.

mwheinz’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta2
Status: Closed (won't fix) » Active

Nope - need to evaluate how this works in 6.x.

mwheinz’s picture

Assigned: Unassigned » mwheinz
mwheinz’s picture

Need to investigate the batch API - that seems to be the correct place to look.

mwheinz’s picture

Title: after a mass import page fails to load--uses up default 30 second time limit (esp. using the "Import local files" method) » Mass import and mass update need to be re-written to use the Batch API.

I'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.

mwheinz’s picture

FileSize
5.06 KB