mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Dont try to generate drag thumbnail from file contents as its too slow
This commit is contained in:
@@ -54,10 +54,8 @@ type drag_status struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func find_drag_image(drag_sources map[string]*drag_source) image.Image {
|
func find_drag_image(drag_sources map[string]*drag_source) image.Image {
|
||||||
all_paths := []string{}
|
|
||||||
for mime, ds := range drag_sources {
|
for mime, ds := range drag_sources {
|
||||||
if ds.path != "" {
|
if ds.path != "" {
|
||||||
all_paths = append(all_paths, ds.path)
|
|
||||||
if strings.HasPrefix(mime, "image/") {
|
if strings.HasPrefix(mime, "image/") {
|
||||||
q, err := imaging.Open(ds.path)
|
q, err := imaging.Open(ds.path)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -72,7 +70,6 @@ func find_drag_image(drag_sources map[string]*drag_source) image.Image {
|
|||||||
for _, path := range q {
|
for _, path := range q {
|
||||||
if path != "" {
|
if path != "" {
|
||||||
uri_list = append(uri_list, path)
|
uri_list = append(uri_list, path)
|
||||||
all_paths = append(all_paths, path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,10 +80,6 @@ func find_drag_image(drag_sources map[string]*drag_source) image.Image {
|
|||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, path := range all_paths {
|
|
||||||
_ = path
|
|
||||||
// TODO: Try to generate an image based preview using the machinery from the choose-files kitten
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user