New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contao 4.8 - not all possible og:image are generated #27
Comments
How do you exactly add those images? For example, the image will not be considered if it is placed directly in the text editor (tinyMCE). |
no, not in the text editor ... |
@fritzmg have you got a running system on that Contao version somewhere? 😇 |
I made a quick test in Contao 4.8 and I cannot confirm the problem. I inserted a |
https://wiewarsdort.at/ |
|
"... There is only the default image generated, choosen in site structure...." |
Which settings are you using? |
|
@qzminski while testing a gallery I indeed noticed an incompatibility with Contao 4.8:
Since Contao 4.8 we have deferred image resizing - however the social images extension wants to check the actual size of the image, before adding it as an @ausi can the target image size be retrieved somehow via a service? |
Hey @ausi what would be the best option here: read maximum dimensions from corresponding JSON file, or somehow force to generate the image at a runtime? |
This would effectively negate the advantage of the deferred image resizing process of Contao 4.8+ whenever the social images extension is installed, since it will process the images of each image, text and gallery content element on each request. |
@fritzmg that is true but I don't really see any other option as we have to know the real image size at the time page is being generated. If the image is deferred and does not exist, we'd either have to generate it or use the maximum image size set in the corresponding JSON file… that may be actually the best solution although it does not solve the problem in 100% as a small image wouldn't be upscaled and could be included despite the dimension limits. |
You can replace
list($width, $height) = (new \Contao\File($strImage))->imageSize; This works with both, deferred and already resized images. |
Thanks a lot @ausi 🍻 |
sorry @qzminski , but after updating the package there's the same issue as before. |
@qzminski you forgot line 62 in |
but that isn't the solution (?) |
I otherwise cannot reproduce the issue of @berecont . I have added a text element with image plus a gallery on one page and got the following output in <meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%282%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1279"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_1.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_10.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_2.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_3.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1279"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_4.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/assets/images/d/Deat_to_Stock_Goods_5-f9d29036.jpg">
<meta property="og:image:width" content="1024">
<meta property="og:image:height" content="1536"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_6.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_7.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_8.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Deat_to_Stock_Goods_9.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%281%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%2810%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%283%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%284%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%285%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1371"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%286%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%287%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1279"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%288%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"><meta property="og:image" content="http://c48.local/files/dts/Death_to_stock_photography_weekend_work%20%289%20of%2010%29.jpg">
<meta property="og:image:width" content="1920">
<meta property="og:image:height" content="1280"> The first og:image is from the text content element, the rest of the images are from the gallery content element. |
@berecont I have found the problem. You are inserting the news reader module as an insert tag which is generated after the |
wow - ok, that's a problem I didn't know ... |
@qzminski will you release 3.5.7 soon? We actually use the extension in 2 live Contao 4.8 installations and the problem I discovered might occur there too. |
Just released 😉 |
Contao 4.8.4
codefog/contao-social_images 3.5.5
There is only the default image generated, choosen in site structure. If you don't choose one, there's no og:image generated.
Other images are not collected and generated as og:image in
the extension is activated in page layout.
this is both in a regular page an in the news page
The text was updated successfully, but these errors were encountered: