-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Closed
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
go 1.12.1 linux/amd64
What did you expect to see?
image shift not depending on saved format.
What did you see instead?
gif image shifted in the opposite direction to all other formats.
(several other image format generating libs tried and gif the only one in disagreement.)
demo example:
package main
import "image"
import "image/png"
import "image/jpeg"
import "image/gif"
import "os"
type offsetImage struct{
image.Image
Rect image.Rectangle
}
func (i offsetImage) Bounds() image.Rectangle{
return i.Rect
}
func main() {
img:=offsetImage{image.Rect(0,0,50,50),image.Rect(0,0,50,50) }
w,_:= os.Create("1.png")
png.Encode(w,img)
w,_= os.Create("1.jpg")
jpeg.Encode(w,img,nil)
w,_= os.Create("1.gif")
gif.Encode(w,img,nil)
img.Rect=image.Rect(30,30,80,80) // same size just offset
w,_= os.Create("2.png")
png.Encode(w,img)
w,_= os.Create("2.jpg")
jpeg.Encode(w,img,nil)
w,_= os.Create("2.gif")
gif.Encode(w,img,nil)
}
output
without shift:all white, all the same as expected
with shift:
(png image above not showing in github md?)
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.





