-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forceGenerateImages
does not seem to be working
#11
Comments
Hi @jmyrland, There was indeed something strange going on. I've spent most of today trying to get the bottom of this issue. It was a case of 'it works on my machine', however one of the tests was failing on the Circle CI runner which totally didn't match what I was seeing locally. In the CI environment, the force generated images weren't loading although the logic of this module follows through correctly right the way down to the point where the graphicsmagick (gm) module does its I've had to put in a workaround in version 1.3.3 which sets a forced waiting time of 250ms which makes the test pass on CI. I tried 100ms and it breaks, so this means a forced wait of one second per 4 images that get generated. I can't see anything upstream in the gm module which points to why this might be happening. I'm waiting to see whether this becomes an issue for people as I'm sure there will eventually be someone trying to process many hundreds of images!! Until then, please can you try version 1.3.3 and see if you're able to now successfully force generate the images? To clarify, forced (pre-emptive) image generation at build time happens only when Hope this helps. Thanks, Barry P.S. You're right about the typo in the README. This has been fixed on master. Cheers! |
Ah, I see - then this won't work in my case. The image generation takes up quite alot of resources, which results in "sluggish" image rendering on first render. My thought, was to generate "placeholders" (really small images, 80px wide max) at the build stage - then load images by request. While the "real" images are generated & loaded, the "placeholder" is displayed. The effect is similar to how medium handles images, and you can see this effect live on solv.as. (It is important to note that I am hosting this on now.sh, which results in a new/fresh server for each deploy, which in turn requires regeneration of all images) Ideally, I want to inline the base64 string inside the html of the placeholder (<1kb). I think this is feasable if the images are generated at the build stage. Maybe an alternate solution is to run This is a feature I would love to have - and I'm glad to help if required :) |
Maybe this could be solved by this (pseudo code) ['@reallifedigital/nuxt-image-loader-module', {
imagesBaseDir: 'images',
imageStyles: {
placeholder: { actions: ['gravity|Center', 'resize|60', 'quality|40' ] },
thumbnail: { actions: ['gravity|Center', 'resize|480|270', 'quality|95'] },
},
forceGenerateImages: {
// imageStyle: globPattern
placeholder: '**/*'
mini: {
pattern: '**/*'
external: {
fullImage: 'https://yourmageserver.com/crop/1600x700' + pattern['filename']
}
}
}
}] |
We ran into the same problem. With |
Hi,
First off, great module! 👍
I've been struggeling to get the
forceGenerateImages
feature to work.Some relevant info:
I've got the following settings:
I want all
placeholders
to be generated at build time. I've tried running build and generate, but nothing seems to triggerforceGenerateImages
.In other words, all images are only generated run time (per request).
At which step (build, start, generate) is this supposed to happen?
Am I missing somthing?
Hope you can help :)
The text was updated successfully, but these errors were encountered: