Send "original" URL as src attribute
Resolves https://github.com/lorenzodejong/next-sanity-image/issues/50
Next.js sends an error if src is the same as the optimized image.
In this case, we sent the optimized src attribute back to the getImgProps function
I understand the fix you're trying to implement here, however this will impact some of the flexibility that the library provides. By defining a base image without any customization options from the imageBuilder option, you remove the capability of cropping/scaling and other image transformations.
This will not be an issue from any of the images from the srcset attribute, however will impact the src image as a fallback.
Could you elaborate on the specific way this fixes the issue in the library? If we know the root cause of the issue, we may be able to come up with a fix which doesn't impact the customizability of the library.
The passed src seems to just be the original resource for the URL.
The src attribute passed to the img tag is still optimized. Check this line: https://github.com/vercel/next.js/blob/00ed837bb4b71ce0c30256e4d07638225b31a7e5/packages/next/src/shared/lib/get-img-props.ts#L231
@lorenzodejong I've updated the tests, but I am unsure if they are actually worth having anymore. It's the loader function result which should be tested.