Comments (5)
From our docs:
Currently supported image format: JPEG, PNG, BMP, GIF, SVG, HEIC
NEF format is currently NOT supported, and the problem seems libwebp
related, I've tried using cwebp
like:
cwebp DSC_0001.NEF -o output.webp
TIFFReadDirectory: Warning, Unknown field with tag 36867 (0x9003) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 37398 (0x9216) encountered.
Saving file 'output.webp'
File: DSC_0001.NEF
Dimension: 160 x 120
Output: 4310 bytes Y-U-V-All-PSNR 37.27 38.71 39.62 37.81 dB
(1.80 bpp)
block count: intra4: 64 (80.00%)
intra16: 16 (20.00%)
skipped: 6 (7.50%)
bytes used: header: 142 (3.3%)
mode-partition: 335 (7.8%)
Residuals bytes |segment 1|segment 2|segment 3|segment 4| total
macroblocks: | 20%| 21%| 38%| 21%| 80
quantizer: | 36 | 30 | 22 | 16 |
filter level: | 11 | 7 | 4 | 2 |
du -ch DSC_0001.NEF
12M DSC_0001.NEF
12M total
du -ch output.webp
8.0K output.webp
8.0K total
This gives similar results from what you've posted.
from webp_server_go.
How about converting NEF (RAW) images to JPG first and then to WEBP?
from webp_server_go.
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 file
to check for a NEF image, you'll find it has no standard dimension data:
file 1.NEF
1.NEF: TIFF image data, big-endian, direntries=25, height=0, bps=0, compression=none, PhotometricInterpretation=RGB, manufacturer=NIKON CORPORATION, model=NIKON XXXXX, orientation=upper-left, width=0
Note
height=0
andwidth=0
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:
NIKON XXXXX <nil>
"300/1"
"300/1"
2
<nil>
<nil>
160
120
While it's correct dimension is 4608 x 3072.
from webp_server_go.
I saw a library from https://github.com/gavinwade12/nef2jpeg that can convert NEF to JPG normally: https://github.com/jeremytorres/rawparser
from webp_server_go.
from webp_server_go.
Related Issues (20)
- Checking if imageHeightWidthRatio is not zero before dividing HOT 2
- -dump-config flag does not work with Docker image HOT 2
- Empty file causes runtime error when it is expected to be a directory HOT 2
- Can't get webp_server_go work HOT 5
- Requests with too large headers fields are not logged HOT 4
- Delete older files from storage HOT 2
- Clear older files autometically HOT 2
- Image not found! HOT 2
- Readme broken link HOT 1
- Exclude certain sub folder HOT 1
- A problem converting GIF images to AVIF format HOT 6
- set maxWidth and/or maxHeight HOT 9
- When the instantaneous request volume is large, a large amount of CPU and memory will be consumed. HOT 1
- Couldn't load xx.ico file HOT 3
- How do I configure and exclude links in MP4 format? HOT 5
- Server don't conversions images to jxl format in Firefox Nightly HOT 3
- Cropping mode environment variable HOT 4
- Directory traversal with malformed HTTP request HOT 3
- Webp Cloud是不是比开源的这个支持更多功能? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webp_server_go.