fix: use raw <img> tags to bypass q-img dialog rendering bug
NiceGUI's ui.image (Quasar q-img) fails to display inside ui.dialog regardless of URL type — shows alt text instead of image. Switched both thumbnail and dialog content to plain HTML <img> tags which the browser renders directly without component interference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-5
@@ -573,11 +573,13 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state,
|
|||||||
if (img_path and img_path.exists() and
|
if (img_path and img_path.exists() and
|
||||||
img_path.suffix.lower() in IMAGE_EXTENSIONS):
|
img_path.suffix.lower() in IMAGE_EXTENSIONS):
|
||||||
img_url = f'/api/image-preview?path={quote(str(img_path))}'
|
img_url = f'/api/image-preview?path={quote(str(img_path))}'
|
||||||
with ui.dialog() as img_dlg, ui.card().style('max-width:90vw'):
|
with ui.dialog() as img_dlg, ui.card().style('max-width:90vw; padding:0'):
|
||||||
ui.image(img_url).style('max-width:80vw; max-height:80vh')
|
ui.html(f'<img src="{img_url}" '
|
||||||
ui.image(img_url).style(
|
f'style="max-width:80vw;max-height:80vh;display:block">')
|
||||||
'width:36px; height:36px; object-fit:cover;'
|
ui.html(
|
||||||
' border-radius:4px; cursor:pointer; flex-shrink:0'
|
f'<img src="{img_url}" '
|
||||||
|
f'style="width:36px;height:36px;object-fit:cover;'
|
||||||
|
f'border-radius:4px;cursor:pointer;flex-shrink:0">'
|
||||||
).on('click', img_dlg.open)
|
).on('click', img_dlg.open)
|
||||||
str_inp = dict_number('Strength', seq, str_key, default=1.0,
|
str_inp = dict_number('Strength', seq, str_key, default=1.0,
|
||||||
step=0.05, format='%.2f').style(
|
step=0.05, format='%.2f').style(
|
||||||
|
|||||||
Reference in New Issue
Block a user