Ignore the original images when have been processed

I’m using Hugo for all image processing without actually using the original image in the final result, since only the different processed sizes are used on the web. That’s why I think it’s a waste of space and a danger to have the original image in the public folder.

The only thing for which if I use the original image is to calculate the width and height and depending on those parameters do some processing operations or others.

That’s why I was wondering if there is any way to prevent the original images from going to the public folder if they are not really being used on the web

I tried to use “ignoreFiles” but the result is that the images are simply not processed and I can not use logic on the original image.

Thank you very much!

Move your images in the /assets/ directory and the originals will not be published.

However that would require a different organization than Page Bundles.

And to get these images you would have to use resources.Get

Thank you, you are right. Unfortunately i need the page bundles. I think i will use a script to exclude the files from uploading to the cdn.