-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
NEF image size is wrong and extra parameters are invalid #281
Comments
From our docs:
NEF format is currently NOT supported, and the problem seems
This gives similar results from what you've posted. |
How about converting NEF (RAW) images to JPG first and then to WEBP? |
No, it's not that easy, NEF images are little bit hard to deal with, for example, if you use
So currently we suggest you to convert those NEF images to JPEG or some other supported image formats before using WebP Server Go to render them. BTW, I've tried https://github.com/rwcarlsen/goexif for extracting info from the above NEF image, and has incorrect results: package main
import (
"fmt"
"os"
"github.com/rwcarlsen/goexif/exif"
"github.com/rwcarlsen/goexif/mknote"
)
func main() {
nefFile, err := os.Open("1.NEF")
if err != nil {
fmt.Println(err)
}
defer nefFile.Close()
exif.RegisterParsers(mknote.All...)
exifData, err := exif.Decode(nefFile)
if err != nil {
fmt.Println(err)
}
camModel, _ := exifData.Get(exif.Model) // normally, don't ignore errors!
fmt.Println(camModel.StringVal())
XResolution, _ := exifData.Get(exif.XResolution)
YResolution, _ := exifData.Get(exif.YResolution)
ResolutionUnit, _ := exifData.Get(exif.ResolutionUnit)
PixelXDimension, _ := exifData.Get(exif.PixelXDimension)
PixelYDmension, _ := exifData.Get(exif.PixelYDimension)
ImageWidth, _ := exifData.Get(exif.ImageWidth)
ImageLength, _ := exifData.Get(exif.ImageLength)
fmt.Println(XResolution)
fmt.Println(YResolution)
fmt.Println(ResolutionUnit)
fmt.Println(PixelXDimension)
fmt.Println(PixelYDmension)
fmt.Println(ImageWidth)
fmt.Println(ImageLength)
} The output from above program is:
While it's correct dimension is 4608 x 3072. |
I saw a library from https://github.com/gavinwade12/nef2jpeg that can convert NEF to JPG normally: https://github.com/jeremytorres/rawparser |
Describe the bug
When converting NEF (NIKON ELECTRIC FILM) format, the resulting webp loses its original pixel ratio. The QUALITY parameter and extra parameters is invalid. Not sure if other RAW formats are ok.
To Reproduce
Just use a NEF image.
Expected behavior
NEF images or other RAW images can work fine.
Screenshots and logs
webp
NEF
Environment (please complete the following information):
Additional context
none
The text was updated successfully, but these errors were encountered: