mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix orientation for all jpg files
This commit is contained in:
parent
34e03e7cf6
commit
c1307103b2
|
@ -117,9 +117,12 @@ func NewNeedle(r *http.Request, fixJpgOrientation bool) (n *Needle, e error) {
|
|||
}
|
||||
n.SetHasLastModifiedDate()
|
||||
|
||||
if fixJpgOrientation && strings.HasSuffix(strings.ToLower(string(n.Name)), ".jpg") {
|
||||
if fixJpgOrientation {
|
||||
loweredName := strings.ToLower(fname)
|
||||
if mimeType == "image/jpeg" || strings.HasSuffix(loweredName, ".jpg") || strings.HasSuffix(loweredName, ".jpeg") {
|
||||
n.Data = images.FixJpgOrientation(n.Data)
|
||||
}
|
||||
}
|
||||
|
||||
n.Checksum = NewCRC(n.Data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue