hayden-fr / ComfyUI-Image-Browsing

GNU General Public License v3.0
11 stars 2 forks source link

Proposal: link to images #8

Closed speters closed 3 weeks ago

speters commented 3 weeks ago

Thx for your plugin.

I modified it to link the thumbnails to the full-scale images (too simple for a pull request):

diff --git a/src/components/DialogExplorer.vue b/src/components/DialogExplorer.vue
index 44d6da8..4e3dd83 100644
--- a/src/components/DialogExplorer.vue
+++ b/src/components/DialogExplorer.vue
@@ -117,11 +117,16 @@
                     ></path>
                   </svg>
                 </div>
-                <img
+                <a
                   v-else-if="rowItem.type === 'image'"
-                  class="h-full w-full object-contain"
-                  :src="`/image-browsing${rowItem.fullname}?preview=true`"
-                />
+                  :href="`/image-browsing${rowItem.fullname}`"
+                  target="_blank"
+                >
+                  <img
+                    class="h-full w-full object-contain"
+                    :src="`/image-browsing${rowItem.fullname}?preview=true`"
+                  />
+                </a>
               </div>
               <div class="flex w-full justify-center overflow-hidden px-1">
                 <span class="overflow-hidden text-ellipsis text-xs">
hayden-fr commented 3 weeks ago

Your suggestion is great.

Originally, I planned to use the preview method to obtain the full-scale image (but I haven't implemented it yet). Now there is a simpler method instead.

hayden-fr commented 3 weeks ago

Added, thanks for your suggestion!