codefog / contao-instagram

Contao extension that displays Instagram feed on your website
MIT License
11 stars 12 forks source link

No more images displayed in feed #42

Closed operatorone closed 12 months ago

operatorone commented 12 months ago

Hi, since some days images are not shown anymore after importing them from Instagram. See here https://www.heiserimkerei.de/ueber-uns/instagram.html

Instagram changed the image format to HEIC, which the importer is not recognizing. In the source code is only an empty img tag visible.

Is there a way I can work around this or is there a fix already?

fritzmg commented 12 months ago

You can let the image be transformed by Contao (if your environment supports HEIC):

# config/config.yaml
contao:
    image:
        valid_extensions:
            - jpg
            - jpeg
            - gif
            - png
            - tif
            - tiff
            - bmp
            - svg
            - svgz
            - webp
            - heic
        sizes:
            instagram:
                formats:
                    heic: [jpg]

Or to also provide WebP for all formats:

# config/config.yaml
contao:
    image:
        valid_extensions:
            - jpg
            - jpeg
            - gif
            - png
            - tif
            - tiff
            - bmp
            - svg
            - svgz
            - webp
            - heic
        sizes:
            instagram:
                formats:
                    gif: [webp, gif]
                    jpg: [webp, jpg]
                    jpeg: [webp, jpeg]
                    webp: [webp, jpg]
                    png: [webp, jpg]
                    heic: [webp, jpg]
operatorone commented 12 months ago

Ok, I will try. But could this the reason the <img src="" alt=""> is completly empty?

fritzmg commented 12 months ago

Likely, yes.

operatorone commented 12 months ago

Cool! Worked like a charm. This trick should be found in the manual 😉

fritzmg commented 12 months ago

See also https://github.com/contao/contao/pull/6540