C2DH / journal-of-digital-history

frontend app for our Digital Journal
GNU General Public License v3.0
21 stars 4 forks source link

v3: figure not displayed #677

Open eliselavy opened 1 week ago

eliselavy commented 1 week ago

Binary content is in the output cell but not displayed:

V3: https://journalofdigitalhistory.org/en/notebook-viewer/JTJGcHJveHktZ2l0aHVidXNlcmNvbnRlbnQlMkZqZGgtb2JzZXJ2ZXIlMkZCdVd2dEpGeGgzd3klMkZtYWluJTJGYXJ0aWNsZS5pcHluYg==?idx=89&v=3

Previous version: https://journalofdigitalhistory.org/en/notebook-viewer/JTJGcHJveHktZ2l0aHVidXNlcmNvbnRlbnQlMkZqZGgtb2JzZXJ2ZXIlMkZCdVd2dEpGeGgzd3klMkZtYWluJTJGYXJ0aWNsZS5pcHluYg==?idx=89

def image_metadata(image: str, metadata:str = None):
    if metadata is not None:
        metadata =  {
            "jdh": {
                "module": "object",
                "object": {
                    "type":"image",
                    "source": [metadata]
                }
            }
        }
    if not Path(image).exists():
        print(f'THE IMAGE DOES NOT EXIST: SKIPPING')
        return   

and by executing code:

Screenshot 2024-11-20 at 15 05 22

frederic-reis commented 1 week ago

The image is not displayed because there is no aspect-ratio and no height tags. It's a bug that appeared by fixing #653

It's fixed now. But without any tag, the height of the picture is defined on the half of the window height (see #653 for the rules) https://journalofdigitalhistory.netlify.app/en/notebook-viewer/JTJGcHJveHktZ2l0aHVidXNlcmNvbnRlbnQlMkZqZGgtb2JzZXJ2ZXIlMkZCdVd2dEpGeGgzd3klMkZtYWluJTJGYXJ0aWNsZS5pcHluYg==?idx=89&v=3

eliselavy commented 2 days ago

@frederic-reis can you look at https://github.com/C2DH/journal-of-digital-history/actions/runs/11936373689/job/33269871656

frederic-reis commented 2 days ago

It's strange because it was deployed on netlify

frederic-reis commented 2 days ago

I re-run and it passes without changing anything