New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image with ImageFillContain seen stretched before correcting for aspect. #1266
Labels
Milestone
Comments
andydotxyz
modified the milestones:
1.3.x,
1.4 - List, Table, Tree, Input Validation and UI Refresh
Oct 5, 2020
andydotxyz
changed the title
Image Display - Image seen stretched before correcting for aspect.
Image with ImageFillContain seen stretched before correcting for aspect.
Oct 20, 2020
andydotxyz
added a commit
to andydotxyz/fyne
that referenced
this issue
Oct 20, 2020
Issue was that we were reading aspect before setting it on the first frame. Fixes fyne-io#1266
3 tasks
andydotxyz
added a commit
that referenced
this issue
Oct 20, 2020
Issue was that we were reading aspect before setting it on the first frame. Fixes #1266
On develop for testing. |
I can still reproduce. Run the below with any jpeg image as package main
import (
"bytes"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/canvas"
"fyne.io/fyne/widget"
"image/jpeg"
"io/ioutil"
"log"
"os"
)
func main() {
// Create Fyne App
a := app.New()
// Create Fyne Window
w := a.NewWindow("Image Jump")
// Create image to hold image
img := &canvas.Image{
FillMode: canvas.ImageFillOriginal,
}
scroller := widget.NewScrollContainer(img)
// Create goroutine to load file contents and update image
go func() {
data, err := ioutil.ReadFile(os.Args[1])
if err != nil {
log.Println("Error:", err)
return
}
i, err := jpeg.Decode(bytes.NewReader(data))
if err != nil {
log.Println("Error:", err)
return
}
img.Image = i
img.Refresh()
scroller.Refresh()
}()
// Add scroller to window
w.SetContent(scroller)
w.Resize(fyne.NewSize(480, 600))
w.ShowAndRun()
} |
Oops, I just noticed I'm using ImageFillOriginal and this issue is about ImageFillContain |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug:
Image first shows as stretched to fill canvas. After a short pause (probably processing time) the image is re-displayed corrected for aspect.
To Reproduce:
Run this code with local image
package main
import (
"fmt"
"imaging"
"os"
)
func main() {
myApp := app.New()
w := myApp.NewWindow("Image")
w.Resize(fyne.NewSize(600, 600)) // problem for all sizes tried
}
Screenshots:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: