snapshot of https://github.com/cortezaproject/corteza.git (2024.9.x, 2026-09-18; blobs > 131072B omitted)
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
This commit is contained in:
21
server/vendor/github.com/edwvee/exiffix/LICENSE
generated
vendored
Normal file
21
server/vendor/github.com/edwvee/exiffix/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 edwvee
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
18
server/vendor/github.com/edwvee/exiffix/README.md
generated
vendored
Normal file
18
server/vendor/github.com/edwvee/exiffix/README.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Exiffix
|
||||
======
|
||||
Exiffix is a one function golang library made to be a replacement for image.Decode to handle orientation stored in EXIF data.
|
||||
|
||||
```exiffix.Decode``` has mostly the same signature as ```image.Decode```. The difference is that it requires ```io.ReadSeeker``` instead of ```io.Seeker```.
|
||||
|
||||
Example
|
||||
======
|
||||
```go
|
||||
file, err := os.Open(path)
|
||||
if err != nil{
|
||||
panic(err)
|
||||
}
|
||||
defer file.Close()
|
||||
img, fmt, err := exiffix.Decode(file)
|
||||
```
|
||||
|
||||
Special thanks to Macilias: part of code is taken from his [repo](https://github.com/Macilias/go-images-orientation)
|
||||
57
server/vendor/github.com/edwvee/exiffix/decode.go
generated
vendored
Normal file
57
server/vendor/github.com/edwvee/exiffix/decode.go
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
package exiffix
|
||||
|
||||
import (
|
||||
"image"
|
||||
"io"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/rwcarlsen/goexif/exif"
|
||||
)
|
||||
|
||||
//Decode is image.Decode handling orientation in EXIF tags if exists.
|
||||
//Requires io.ReadSeeker instead of io.Reader.
|
||||
func Decode(reader io.ReadSeeker) (image.Image, string, error) {
|
||||
img, fmt, err := image.Decode(reader)
|
||||
if err != nil {
|
||||
return img, fmt, err
|
||||
}
|
||||
reader.Seek(0, io.SeekStart)
|
||||
orientation := getOrientation(reader)
|
||||
switch orientation {
|
||||
case "1":
|
||||
case "2":
|
||||
img = imaging.FlipH(img)
|
||||
case "3":
|
||||
img = imaging.Rotate180(img)
|
||||
case "4":
|
||||
img = imaging.Rotate180(imaging.FlipH(img))
|
||||
case "5":
|
||||
img = imaging.Rotate270(imaging.FlipV(img))
|
||||
case "6":
|
||||
img = imaging.Rotate270(img)
|
||||
case "7":
|
||||
img = imaging.Rotate90(imaging.FlipV(img))
|
||||
case "8":
|
||||
img = imaging.Rotate90(img)
|
||||
}
|
||||
|
||||
return img, fmt, err
|
||||
}
|
||||
|
||||
func getOrientation(reader io.Reader) string {
|
||||
x, err := exif.Decode(reader)
|
||||
if err != nil {
|
||||
return "1"
|
||||
}
|
||||
if x != nil {
|
||||
orient, err := x.Get(exif.Orientation)
|
||||
if err != nil {
|
||||
return "1"
|
||||
}
|
||||
if orient != nil {
|
||||
return orient.String()
|
||||
}
|
||||
}
|
||||
|
||||
return "1"
|
||||
}
|
||||
Reference in New Issue
Block a user