mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 19:29:15 +00:00
Implement proper photo rotation based on exif data
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package utils
|
||||
|
||||
import "crypto/rand"
|
||||
|
||||
import "math/big"
|
||||
|
||||
import "log"
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func GenerateToken() string {
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
@@ -23,3 +24,20 @@ func GenerateToken() string {
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
type PhotoviewError struct {
|
||||
message string
|
||||
original error
|
||||
}
|
||||
|
||||
func (e PhotoviewError) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.message, e.original)
|
||||
}
|
||||
|
||||
func HandleError(message string, err error) PhotoviewError {
|
||||
log.Printf("ERROR: %s: %s", message, err)
|
||||
return PhotoviewError{
|
||||
message: message,
|
||||
original: err,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user