Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next/image optimized image does not look like original image #27092

Closed
davidgaspardev opened this issue Jul 11, 2021 · 3 comments · Fixed by #29506
Closed

next/image optimized image does not look like original image #27092

davidgaspardev opened this issue Jul 11, 2021 · 3 comments · Fixed by #29506
Assignees
Milestone

Comments

@davidgaspardev
Copy link

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

15.7.0

What browser are you using?

Safari

What operating system are you using?

macOS

How are you deploying your application?

yarn dev

Describe the Bug

I am using the Next.js Image component and when it is reered to Image in the browser, the image is damaged, but when I use the normal img HTML element the image is normal, but the deploy requires next/image.

There is another image very similar to this that works normally.

Screen Shot 2021-07-11 at 20 05 10

Expected Behavior

Expected Behavior is the TeamViewer icon image normally render like AnyDesk.

To Reproduce

import Image from 'next/image'

export default function Test() {
  return (
    <div>
      { /** Team Viewer button (link) */}
      <div className="floating-button" style={{ backgroundColor: "var(--color-teamviewer)", right: 160 }} >
          <Image 
            src={"/images/png/teamviewer.png"}
            alt="TeamViewer"
            width={24}
            height={24}/>

        <h6>Team Viewer</h6>
      </div>

      { /** AnyDesk button (link) */ }
      <div className="floating-button" style={{ backgroundColor: "var(--color-anydesk)" }} >
        <Image 
          src={"/images/png/anydesk.png"}
          alt="AnyDesk"
          width={24}
          height={24} />

        <h6>AnyDesk</h6>
      </div>
    </div>
  );
}

Assets

anydesk
teamviewer

Result

Screen Shot 2021-07-11 at 20 05 10

@davidgaspardev davidgaspardev added the bug Issue was opened via the bug report template. label Jul 11, 2021
@styfle
Copy link
Member

styfle commented Jul 15, 2021

Looks like a bug with squoosh (the package we use to optimize images)

See GoogleChromeLabs/squoosh#1102

@styfle styfle added kind: bug and removed bug Issue was opened via the bug report template. labels Jul 21, 2021
@styfle styfle self-assigned this Jul 21, 2021
@styfle styfle added this to the Iteration 23 milestone Jul 21, 2021
@styfle styfle changed the title next/image is damaged the original image next/image optimized image does not look like original image Jul 21, 2021
@kodiakhq kodiakhq bot closed this as completed in #29506 Oct 6, 2021
kodiakhq bot pushed a commit that referenced this issue Oct 6, 2021
Bump `squoosh` to the latest version, currently commit [cad09160](GoogleChromeLabs/squoosh@cad0916).

Ideally, we would use the version published to npm but it hasn't been published in [two months](https://www.npmjs.com/package/@squoosh/lib?activeTab=versions) and we have a patch (#23565) that isn't available upstream.

This also is a precursor to getting support for AVIF.

- Fixes #27092
- Fixes #26527 
- Reapplies the patch from #23565
@styfle
Copy link
Member

styfle commented Oct 6, 2021

This has been fixed in v11.1.3-canary.46.

You can try it out today with yarn add next@canary, thanks!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
Bump `squoosh` to the latest version, currently commit [cad09160](GoogleChromeLabs/squoosh@cad0916).

Ideally, we would use the version published to npm but it hasn't been published in [two months](https://www.npmjs.com/package/@squoosh/lib?activeTab=versions) and we have a patch (vercel#23565) that isn't available upstream.

This also is a precursor to getting support for AVIF.

- Fixes vercel#27092
- Fixes vercel#26527 
- Reapplies the patch from vercel#23565
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants