Skip to content
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

How to get $info->image for an image link? #452

Closed
tnaseem opened this issue Jun 22, 2021 · 2 comments
Closed

How to get $info->image for an image link? #452

tnaseem opened this issue Jun 22, 2021 · 2 comments

Comments

@tnaseem
Copy link

tnaseem commented Jun 22, 2021

I've just come back to this package after a few years(!). I was using v2.7.

I've just updated to the latest and got most things working. However, although the image links get the HTML, $info->image is empty.

I was using this as a direct link to the image for my thumbnails. Is there any way I can do this with the new version?

Example image I was grabbing:
https://i.guim.co.uk/img/media/6cf196bbf37677d3e9624e6365ce282b6b451a73/0_236_5184_3110/master/5184.jpg?width=1920&quality=85&auto=format&fit=max&s=8a1a9a919bc99863c8677ac51e794bc9

@tnaseem
Copy link
Author

tnaseem commented Jun 22, 2021

As a side note, I did have a config array I used to send to the original Embed::create() call:

$info = Embed::create($url, $config);

Which had the following settings:

            'html' => [
                'max_images' => 1,
                'external_images' => true
            ],

Not sure how to pass this in v4.3.1. I'm assuming this is the setting I should be using to grab the direct image link?

oscarotero added a commit that referenced this issue Jun 22, 2021
@oscarotero
Copy link
Owner

The new version no longer collect all images in the page, just return the image defined by the webpage in some <meta> tags etc. You have more info here: #343

And about the $info->image for direct links to images, good point. I just release a new version fixing this.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants