docpad/docpad-plugin-thumbnails

Use thumbnails plugin without copying source image to "out"?

jasonw22 opened this issue · 2 comments

I am developing a photo-centric eBook for packaging and distribution via PhoneGap. I'm using the thumbnails plugin along with picturefill for responsive images. I'd like to be able to refer to source photos (which are very high resolution unoptimized images) in @getThumbnail() but I do not want those source images copied to the "out" folder that will ultimately get packaged and distributed. How do I accomplish this?

Hey Jason,

That's a good question. I'd probably achieve that by running a grunt task post-generation (such as https://github.com/reputation/grunt-clean) to remove all the original source files from the /out dir. To make that easier you could rename all your source files as [name].hires.jpg or similar so you can match them easier.

I believe the thumbnail plugin will strip all intermediate extensions from the source filename so that image1.hires.jpg will be generated as image1.thumb_default_w100h100q85.jpg (for example). This is an unintended side effect that will work in your favor.

I think this is a really great suggestion. Thanks!