rbuchberger / jekyll_picture_tag

Easy responsive images for Jekyll.
https://rbuchberger.github.io/jekyll_picture_tag/
BSD 3-Clause "New" or "Revised" License
617 stars 103 forks source link

Jekll build command and image generation #14

Closed WillsB3 closed 10 years ago

WillsB3 commented 11 years ago

Hi,

I've just got Picture Tag working on my Jekyll site and it's great! I have a question regarding the image generation process though.

Normall during development new images are compiled on the fly as a result of running jekyll serve -w. As part of my build process though, I'm running "jekyll build". It seems that Jekyll Picture Tag regenerates all images when using this command, even if the picture configuration options in _config.yaml havn't changed. I don't think I fully understand the problem so might be wrong here though.

Is this the correct/expected behaviour? I'd have thought that Picture Tag would only regenerate images for image sizes/ppi's which weren't already generated instead of regenerating ALL the images again.

I only have 10 or so screenshot images in my Jekyll site so far, but running jekyll build already takes over 10 minutes with 3 source sizes (2 custom and default) and 2 PPI's in _config.yaml.

Am I doing something wrong?

If it's useful my source is here

Thanks!

robwierzbowski commented 11 years ago

It shouldn't rebuild the whole picture cache, and build and serve should make no difference. If the images are being erased it might be a problem with keep_files. I'll take a look over the weekend.

On Thursday, August 29, 2013, WillsB3 wrote:

Hi,

I've just got Picture Tag working on my Jekyll site and it's great! I have a question regarding the image generation process though.

Normall during development new images are compiled on the fly as a result of running jekyll serve -w. As part of my build process though, I'm running "jekyll build". It seems that Jekyll Picture Tag regenerates all images when using this command, even if the picture configuration options in _config.yaml havn't changed. I don't think I fully understand the problem so might be wrong here though.

Is this the correct/expected behaviour? I'd have thought that Picture Tag would only regenerate images for image sizes/ppi's which weren't already generated instead of regenerating ALL the images again.

I only have 10 or so screenshot images in my Jekyll site so far, but running jekyll build already takes over 10 minutes with 3 source sizes (2 custom and default) and 2 PPI's in _config.yaml.

Am I doing something wrong?

If it's useful my source is herehttps://github.com/WillsB3/willsb3.github.io/tree/source

Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/robwierzbowski/jekyll-picture-tag/issues/14 .

Rob Wierzbowski @robwierzbowski http://twitter.com/#!/robwierzbowski http://github.com/robwierzbowski http://robwierzbowski.com

robwierzbowski commented 11 years ago

keep_files is a list of files that Jekyll shouldn't delete in the dist directory. The plugin adds the output directory to keep_files programmatically on each compile. If you're seeing one or two deleted it's probably not keep_files though, that would be the whole directory.

Can you check if the regenerated images have different hashes? JIT compares a MD5 hash of the source image to see if it needs to regenerate. Any change that's saved in the file (even metadata, non-visual information, etc.) will trigger creation of a new image.

Rob Wierzbowski @robwierzbowski http://twitter.com/#!/robwierzbowski http://github.com/robwierzbowski http://robwierzbowski.com

On Thu, Aug 29, 2013 at 3:17 PM, WillsB3 notifications@github.com wrote:

Quick update on this, it seems that even when running Jekyll serve -w every now and again some of the images get regenerated.

Is keep_files an option I need to configure within my Jekyll config?

— Reply to this email directly or view it on GitHubhttps://github.com/robwierzbowski/jekyll-picture-tag/issues/14#issuecomment-23516128 .

WillsB3 commented 11 years ago

Are you referring to the hash that is on the end of the filename for each generated image? If so I don't believe these are changing because if they were I'd see new files to commit in git once the generation was complete. As it stands, no images show up as new or modified in git after running a jekyll build, I assume this means the hashes do not change between build runs. Is this a sensible assumption?

robwierzbowski commented 11 years ago

It is. They should only change when the source image changes (for the cache busting).

robwierzbowski commented 10 years ago

Since I can't reproduce I'm going to close this issue. If you can get steps to reproduce on a clean install, please reopen.