Can't disable image processing

Hello!

I have a site built using Astro and Sanity that I’m deploying here on Netlify. When I run it locally the images work fine, but when deployed the image src is being changed with /.netlify/images?url= added at the beginning and all the special characters converted.

It seems to me that there is asset optimization going on? I’ve tried adding the skip_processing = true in the netlify.toml file, but it is still happening.

Please advise! Thanks in advance!

@ramoshe The URL’s indicate they’re for the Netlify Image CDN.

I’m not aware of that being something where URL’s are automatically rewritten.

My guess is that if you run your Build command locally you’ll see that Astro is producing those URL’s itself.

Since Astro’s Deploy your Astro Site to Netlify documenation immediately references this “adapter” @astrojs/netlify you’re probably using it.

You’ll note in the documentation for the adapter that it mentions it applies the Netlify Image CDN by default.

This adapter by default uses the Netlify Image CDN to transform images on-the-fly without impacting build times. It’s implemented using an Astro Image Service under the hood.

They also provide instructions on how to configure the adapter to opt out:

astro.config.mjs

import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';

export default defineConfig({
  // ...
  output: 'server',
  adapter: netlify({
    imageCDN: false,
  }),
});

A key point for your future debugging efforts, when you believe something is occurring only when deployed you should first run your Build command locally and check the output, it can save you time looking in the wrong place.

Thank you so much, that was exactly the issue. I will keep that debugging tip in mind in the future! I had just assumed it was a Netlify issue because it said Netlify lol.

Thanks again!