Is there a way that i can check if image url from instagram is not broken? For example if i delete the image in the instagram. It will display a broken image.
I can't put a condition to that because it still has a url. It's just it's broken.
Is anyone here fix this issue already?
you can use the onerror= attribute of <img> element, have it load a placeholder image if the image url failed to load, like this:
<img src="https://scontent.cdninstagram.com/.../xxxx.jpg" border="0" onerror="this.src='/placeholder_photo.png'">
Related
I am creating a custom module. Where in the backend user will be able to upload background image of a section. I have a binary field in the backend for that.
But for some reason the image is not showing. Here is the line of qweb code I am using -
<div id="comments1" class="parallax-section" t-att-style="'background-image: url(data:image/png;base64,'+res_company.website_logo_img+');'">
This loads the data in binary format incompatible way.
Following is the screenshot when I first load the webpage and image not shows-
Google developer Tools inspect element view
Following is the screenshot when I just take than line in editable mode and hit enter. The image shows nice and clear:
Google developer Tools inspect element view
Can anyone tell me what is the problem?
I started playing with Azure blob storage and uploaded a few images. I also added a custom domain. So now if I use a browser and go to http://images.example.com/some/fileName.jpg I can see the image. But if I use this url in an img tag like so:
<img src="http://images.example.com/some/fileName.jpg" />
the image is broken. Any idea why?
UPDATE
So far I've found out that if I use the original link in the tag it works fine:
<img src="http://example.blob.core.windows.net/images/some/fileName.jpg" />
So I guess the problem originates from the custom domain.
The content type is set to image/jpg
#ShiranDror, there is a exsiting answered SO thread Getting broken images from blob storage in Azure websites which is similar with yours.
The issue might be caused by the operation latency. Please try to set the start time of the operation for Blob storage client.
For C#, setting the StartTime for OperationContext. And for Java, using the function setClientTimeInMs for OperationContext.
Well I narrowed it down to something wrong with the CNAME. I eventually just deleted the CNAME and the storage, and recreated them. Now it works. I'm not sure what exactly was wrong but it had something to do with the return MIME when tying to access the file via the custom domain. Thank you all for helping.
i wanted to know if there is another way i could load the playlist image instead of loading the whole playlist and then fetch the image, i know that on the web platform you have a function that called imageFor and you can insert a playlist URI and get an Image.
how ever on the iOS (cocoalibspotify) you must have the image URI if you want to load it directly and if not i need to load the whole playlist.
will be glad to know if i'm missing something.
CocoaLibSpotify doesn't support playlist images at all - SPPlaylist doesn't have an image property.
I'm new to developing Chrome Extensions, but have programming experience. I would like to know if it is possible to embed an external image in every website that the user visits?
e.g. a small banner image at the top of every website, I have looked into 'content scripts' but I'm not sure if the image has to be on the website directory already or if you can load an external image.
Short answer:
YES!
Long answer:
Yes, you can use an external image. But you I'd not recommend to you, for example, inject an <img> tag in the page. I've experienced some cross-domain errors eventually with this method.
That's the way I do:
First of all you should add the image host domain into the manifest permissions.
manifest.json:
{
...
"permissions": ["http://image-domain.com/images/*"]
...
}
Then load the image from the extension domain and inject the image data in some <img> tag.
Hope it helps...
I would like to download images with a certain tag from Instagram with their likes. With this post I hope to get some advice or tips on how to do this. I have no experience with web scraping related stuff or web API usages. One of my questions is: can you create a program like this in python code or can you only do this using a webpage?
So far I have understood the following. To get images with a certain tag you have to:
need a valid access_token to even gain access to images by tag, which can be done like this. However, when I sign in you need to give a website. Does this indicate that you can only use the API's on websites rather than a python program for instance?
you use a media Tag Endpoint to search for tags by name.
I have no idea what the latest step will return exactly, but I expect that it will give me a specific image id that contains the tag. Correct? Now I will also need to get the likes belonging to these images. Just like latest step from before:
you use a likes Tag Endpoint to get a list of users that liked the image of which of course you can get the length.
If I can accomplish all of these steps it seems like I can achieve my original goal. I googled if there was something out there already. The only thing I could find was InstaRaider, but this did not seem to fit my description because it web scraped only the images from a specific user and not by tag or its likes. Any suggestions or ideas would be very helpful, I have only programmed in python and Java before..
I can only tell you that for URL you can use the localhost as this:
http://127.0.0.1
OR
http://localhost
I have also tried to do exactly the same before, but I could not, so I used a website to search for tags and images:
http://iconosquare.com/search/[HASHTAG]