Comments (11)
Looks like an issue with color indexing, see #7
Guess when github.com/RobCherry/vibrant is gone, the issue will be gone...
from photoprism.
Thanks for having a look! I tried to import only the photo that caused the segfault in a new docker instance, and the crash occurred again.
I don't know if it is of any help, but here is a link to the photo that triggers this bug http://lithops.se/IMG_20170425_062158425.jpg (Original, ~10 MB large)
from photoprism.
@lastzero , @gmelchett
I tested @gmelchett 's image on vibrant library.
And I figured out the following issue of go image library that some special jpg cannot decode.
golang/go#10447
reproducing
wget http://lithops.se/IMG_20170425_062158425.jpg -O sample.jpg
and following code runs, then it can be output invalid JPEG format: short Huffman data
package main
import (
"fmt"
"image"
_ "image/jpeg" // "net/http"
"os"
"github.com/RobCherry/vibrant"
)
func main() {
file, _ := os.Open("sample.jpg")
decodedImage, _, err := image.Decode(file)
if err != nil {
fmt.Println(err)
}
palette := vibrant.NewPaletteBuilder(decodedImage).Generate()
fmt.Println(palette)
}
result:
$go run main.go
invalid JPEG format: short Huffman data
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x10c8329]
goroutine 1 [running]:
github.com/RobCherry/vibrant.NewPaletteBuilder(0x0, 0x0, 0x1)
/Users/yugo-horie/go/src/github.com/RobCherry/vibrant/palette.go:202 +0x29
main.main()
/Users/yugo-horie/vibrant_test/main.go:26 +0xc7
exit status 2
But also I think it's better to be handling those errors properly.
from photoprism.
Would https://github.com/disintegration/imaging also be affected? This is what we're using for resizing etc...
from photoprism.
I checked github.com/disintegration/imaging is affected because
image.Decode
is called by imaging.Open(m.filename, imaging.AutoOrientation(true))
in your code.
i.e.
photoprism/internal/photoprism/thumbnails.go
Line 103 in 6844c5f
but it maynot cause segfalt if you care failed safe the error that is catches next statements.
from photoprism.
So ultimately that means we need to replace "image/jpeg" or we can not import certain images as the issue was closed by the golang team. Any opinions / alternatives?
from photoprism.
Looking at golang/go/issues/10447 it looks like the cause could be that the image is truncated, and indeed my photo is truncated. In Firefox (62), the bottom lines are white, while in Gimp (2.10) only the down right corner isn't correct.
The photos is taken by a Qualcomm based mobile phone with stock Android. (Moto X Force)
from photoprism.
So ignoring it would be OK until we find a better solution?
from photoprism.
Yes, it would be OK. However, it would be nice it photoprism didn't crash upon such images. Ignoring them would be prefered, maybe copy/move these faulty images to a special folder with faulty images?
from photoprism.
Of course it shouldn't crash later, but for now this is what we want. Fail fast. Otherwise, nobody would have complained and it might not have gotten any attention. Now we know there is a problem.
from photoprism.
Think we can close this.
from photoprism.
Related Issues (20)
- Location information for the island of Aruba incorrect HOT 3
- Config: custom permission of unix socket
- Incorrect location information for Nusfjord, Lofoten HOT 2
- Reindexing a non blank library doesn't eliminate old data from library/originals HOT 3
- Incorrect Thumbnails for some videos HOT 1
- Feature Request: Allows Adding Custom Fields
- Control process exited, code=exited, status=1/FAILURE HOT 5
- When issuing a scan getting ERRO index: database is locked in image.jpg (purge duplicate) HOT 2
- FFmpeg: Improve the quality of HDR video thumbnails HOT 10
- Feature Request: Customer Review Tools in Shared Folders (❤️ or rating system) (Option: Review Mode)
- Category: Search - Reverse Image Search HOT 1
- Intel QSV: Portrait Live Photos transcoded in avc codec are in landscape HOT 4
- API: Some updates fail silently in case of database errors HOT 1
- Feature Request: upload towards google photos HOT 4
- Feature Request: Do not block entire page when viewing video with Picture-in-Picture mode
- Change the default search results sort
- Category: Bundle tensorflow in the docker image or provide an interface to use pre-dowloaded binary file. HOT 6
- Search: Exclude sidecar files when sorting by file size
- Search: Allow to disable List View in the UI
- VirtualBox: TensorFlow with AVX2 support does not work due to missing FMA instructions HOT 4
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 photoprism.