meta_oxide 0.1.1

Universal metadata extraction library supporting 13 formats (HTML Meta, Open Graph, Twitter Cards, JSON-LD, Microdata, Microformats, RDFa, Dublin Core, Web App Manifest, oEmbed, rel-links, Images, SEO) with 7 language bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
"""
Tests for JSON-LD ImageObject type

Tests the extraction of Schema.org ImageObject structured data
"""

import meta_oxide
import pytest


class TestImageObjectBasic:
    """Test basic ImageObject extraction"""

    def test_imageobject_basic(self):
        """Test minimal image with contentUrl"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/photo.jpg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["contentUrl"] == "https://example.com/photo.jpg"

    def test_imageobject_with_name(self):
        """Test image with name/title"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Beautiful Sunset",
                "contentUrl": "https://example.com/sunset.jpg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "Beautiful Sunset"
        assert objects[0]["contentUrl"] == "https://example.com/sunset.jpg"

    def test_imageobject_with_description(self):
        """Test image with description/alt text"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Mountain Landscape",
                "description": "Panoramic view of snow-capped mountains at dawn",
                "contentUrl": "https://example.com/mountains.jpg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "Mountain Landscape"
        assert objects[0]["description"] == "Panoramic view of snow-capped mountains at dawn"


class TestImageObjectDimensions:
    """Test ImageObject width and height"""

    def test_imageobject_with_dimensions(self):
        """Test image with width and height in pixels"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/photo.jpg",
                "width": 1920,
                "height": 1080
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["width"] == 1920
        assert objects[0]["height"] == 1080

    def test_imageobject_portrait(self):
        """Test portrait orientation image"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Portrait Photo",
                "contentUrl": "https://example.com/portrait.jpg",
                "width": 1080,
                "height": 1920
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["width"] == 1080
        assert objects[0]["height"] == 1920


class TestImageObjectEncoding:
    """Test ImageObject encodingFormat (MIME type)"""

    def test_imageobject_with_encoding(self):
        """Test image with encodingFormat"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/photo.jpg",
                "encodingFormat": "image/jpeg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["encodingFormat"] == "image/jpeg"

    def test_imageobject_png(self):
        """Test PNG image"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/logo.png",
                "encodingFormat": "image/png"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["encodingFormat"] == "image/png"

    def test_imageobject_webp(self):
        """Test WebP image"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/modern.webp",
                "encodingFormat": "image/webp"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["encodingFormat"] == "image/webp"


class TestImageObjectThumbnail:
    """Test ImageObject thumbnail (nested ImageObject)"""

    def test_imageobject_with_thumbnail(self):
        """Test image with thumbnail ImageObject"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "High Resolution Photo",
                "contentUrl": "https://example.com/photo-4k.jpg",
                "width": 3840,
                "height": 2160,
                "thumbnail": {
                    "@type": "ImageObject",
                    "contentUrl": "https://example.com/photo-thumb.jpg",
                    "width": 150,
                    "height": 150
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "High Resolution Photo"
        assert objects[0]["width"] == 3840
        # Thumbnail should be present as nested object
        assert "thumbnail" in objects[0]


class TestImageObjectUrls:
    """Test ImageObject URL fields"""

    def test_imageobject_content_and_page_url(self):
        """Test image with both contentUrl (direct file) and url (page)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Gallery Photo",
                "contentUrl": "https://example.com/images/photo123.jpg",
                "url": "https://example.com/gallery/photo123"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["contentUrl"] == "https://example.com/images/photo123.jpg"
        assert objects[0]["url"] == "https://example.com/gallery/photo123"


class TestImageObjectCaption:
    """Test ImageObject caption"""

    def test_imageobject_with_caption(self):
        """Test image with caption"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Historic Moment",
                "contentUrl": "https://example.com/historic.jpg",
                "caption": "First landing on the moon, July 20, 1969"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["caption"] == "First landing on the moon, July 20, 1969"


class TestImageObjectCreator:
    """Test ImageObject creator/photographer"""

    def test_imageobject_with_creator(self):
        """Test image with creator (Person)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Wildlife Photography",
                "contentUrl": "https://example.com/wildlife.jpg",
                "creator": {
                    "@type": "Person",
                    "name": "Jane Photographer",
                    "url": "https://example.com/photographers/jane"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "Wildlife Photography"
        # Creator should be present as nested object
        assert "creator" in objects[0]

    def test_imageobject_with_organization_creator(self):
        """Test image with creator (Organization)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Corporate Photo",
                "contentUrl": "https://example.com/corporate.jpg",
                "creator": {
                    "@type": "Organization",
                    "name": "Professional Photo Studio",
                    "url": "https://photostudio.com"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert "creator" in objects[0]


class TestImageObjectCopyright:
    """Test ImageObject copyright and licensing"""

    def test_imageobject_with_license(self):
        """Test image with copyright holder and license"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Licensed Photo",
                "contentUrl": "https://example.com/photo.jpg",
                "copyrightHolder": {
                    "@type": "Person",
                    "name": "Copyright Owner"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["license"] == "https://creativecommons.org/licenses/by/4.0/"
        assert "copyrightHolder" in objects[0]

    def test_imageobject_creative_commons(self):
        """Test image with Creative Commons license"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "CC Licensed Image",
                "contentUrl": "https://example.com/cc-photo.jpg",
                "license": "https://creativecommons.org/licenses/by-sa/4.0/",
                "copyrightHolder": {
                    "@type": "Organization",
                    "name": "Photo Archive Foundation"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["license"] == "https://creativecommons.org/licenses/by-sa/4.0/"


class TestImageObjectUploadDate:
    """Test ImageObject uploadDate"""

    def test_imageobject_with_upload_date(self):
        """Test image with uploadDate (ISO 8601)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Recent Upload",
                "contentUrl": "https://example.com/recent.jpg",
                "uploadDate": "2024-01-15T10:30:00Z"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["uploadDate"] == "2024-01-15T10:30:00Z"

    def test_imageobject_upload_date_only(self):
        """Test image with date-only uploadDate"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "contentUrl": "https://example.com/dated.jpg",
                "uploadDate": "2024-03-20"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["uploadDate"] == "2024-03-20"


class TestImageObjectComplete:
    """Test complete ImageObject with all fields"""

    def test_imageobject_complete(self):
        """Test image with all supported fields"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Professional Landscape Photography",
                "description": "Award-winning landscape photograph of Yosemite Valley",
                "contentUrl": "https://example.com/images/yosemite-4k.jpg",
                "url": "https://example.com/gallery/yosemite",
                "width": 3840,
                "height": 2160,
                "encodingFormat": "image/jpeg",
                "thumbnail": {
                    "@type": "ImageObject",
                    "contentUrl": "https://example.com/images/yosemite-thumb.jpg",
                    "width": 200,
                    "height": 112
                },
                "caption": "Yosemite Valley at sunset, captured from Tunnel View",
                "creator": {
                    "@type": "Person",
                    "name": "Ansel Adams Jr.",
                    "url": "https://example.com/photographers/ansel"
                },
                "copyrightHolder": {
                    "@type": "Person",
                    "name": "Ansel Adams Jr."
                },
                "license": "https://creativecommons.org/licenses/by-nc-nd/4.0/",
                "uploadDate": "2024-02-15T14:22:30Z"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        img = objects[0]

        assert img["@type"] == "ImageObject"
        assert img["name"] == "Professional Landscape Photography"
        assert img["description"] == "Award-winning landscape photograph of Yosemite Valley"
        assert img["contentUrl"] == "https://example.com/images/yosemite-4k.jpg"
        assert img["url"] == "https://example.com/gallery/yosemite"
        assert img["width"] == 3840
        assert img["height"] == 2160
        assert img["encodingFormat"] == "image/jpeg"
        assert img["caption"] == "Yosemite Valley at sunset, captured from Tunnel View"
        assert img["license"] == "https://creativecommons.org/licenses/by-nc-nd/4.0/"
        assert img["uploadDate"] == "2024-02-15T14:22:30Z"
        # Complex nested objects
        assert "thumbnail" in img
        assert "creator" in img
        assert "copyrightHolder" in img


class TestImageObjectEdgeCases:
    """Test edge cases for ImageObject"""

    def test_imageobject_minimal(self):
        """Test minimal ImageObject with only required context"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        # Optional fields should not be present
        assert "name" not in objects[0]
        assert "contentUrl" not in objects[0]

    def test_imageobject_in_graph(self):
        """Test ImageObject within @graph"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@graph": [
                    {
                        "@type": "ImageObject",
                        "name": "First Image",
                        "contentUrl": "https://example.com/img1.jpg"
                    },
                    {
                        "@type": "ImageObject",
                        "name": "Second Image",
                        "contentUrl": "https://example.com/img2.jpg"
                    }
                ]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 2
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "First Image"
        assert objects[1]["@type"] == "ImageObject"
        assert objects[1]["name"] == "Second Image"


class TestImageObjectIntegration:
    """Test ImageObject integration with extract_all()"""

    def test_extract_all_includes_imageobject(self):
        """Test that extract_all() includes ImageObject"""
        html = """
        <html>
        <head>
            <title>Photo Gallery</title>
            <meta property="og:title" content="Photo Gallery">
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Gallery Featured Image",
                "contentUrl": "https://example.com/featured.jpg",
                "width": 1200,
                "height": 800
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        data = meta_oxide.extract_all(html)

        assert "meta" in data
        assert "opengraph" in data
        assert "jsonld" in data

        assert len(data["jsonld"]) == 1
        assert data["jsonld"][0]["@type"] == "ImageObject"
        assert data["jsonld"][0]["name"] == "Gallery Featured Image"
        assert data["jsonld"][0]["width"] == 1200

    def test_multiple_types_with_imageobject(self):
        """Test ImageObject alongside other Schema.org types"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Article Hero Image",
                "contentUrl": "https://example.com/hero.jpg"
            }
            </script>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Article",
                "headline": "Photography Article",
                "image": "https://example.com/hero.jpg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 2
        types = [obj["@type"] for obj in objects]
        assert "ImageObject" in types
        assert "Article" in types


class TestImageObjectRealWorld:
    """Test with real-world ImageObject examples"""

    def test_photo_gallery(self):
        """Test realistic photo gallery ImageObject"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Northern Lights over Iceland",
                "description": "Aurora Borealis dancing over the Icelandic landscape",
                "contentUrl": "https://photos.example.com/iceland/northern-lights-8k.jpg",
                "url": "https://gallery.example.com/nature/iceland/aurora-001",
                "width": 7680,
                "height": 4320,
                "encodingFormat": "image/jpeg",
                "thumbnail": {
                    "@type": "ImageObject",
                    "contentUrl": "https://photos.example.com/iceland/northern-lights-thumb.jpg",
                    "width": 300,
                    "height": 169
                },
                "caption": "Northern Lights over Kirkjufell mountain, Iceland",
                "creator": {
                    "@type": "Person",
                    "name": "Nordic Photographer",
                    "url": "https://gallery.example.com/photographers/nordic"
                },
                "copyrightHolder": {
                    "@type": "Person",
                    "name": "Nordic Photographer"
                },
                "license": "https://creativecommons.org/licenses/by-nc/4.0/",
                "uploadDate": "2024-03-10T08:15:00Z"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        img = objects[0]
        assert img["@type"] == "ImageObject"
        assert img["name"] == "Northern Lights over Iceland"
        assert img["width"] == 7680
        assert img["height"] == 4320
        assert img["encodingFormat"] == "image/jpeg"

    def test_stock_photo(self):
        """Test stock photography ImageObject"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Business Meeting",
                "description": "Diverse team of professionals in a modern office",
                "contentUrl": "https://stock.example.com/photos/business-meeting-001.jpg",
                "width": 5120,
                "height": 3840,
                "encodingFormat": "image/jpeg",
                "creator": {
                    "@type": "Organization",
                    "name": "Professional Stock Photos Inc"
                },
                "license": "https://stock.example.com/licenses/standard",
                "uploadDate": "2024-01-22T00:00:00Z"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["name"] == "Business Meeting"
        assert "creator" in objects[0]

    def test_product_image(self):
        """Test product photography ImageObject"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "ImageObject",
                "name": "Wireless Headphones - Front View",
                "contentUrl": "https://cdn.shop.example.com/products/headphones-wh1000-front.jpg",
                "width": 2000,
                "height": 2000,
                "encodingFormat": "image/jpeg",
                "thumbnail": {
                    "@type": "ImageObject",
                    "contentUrl": "https://cdn.shop.example.com/products/headphones-wh1000-thumb.jpg",
                    "width": 250,
                    "height": 250
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "ImageObject"
        assert objects[0]["width"] == 2000
        assert objects[0]["height"] == 2000


if __name__ == "__main__":
    pytest.main([__file__, "-v"])