Trouble Displaying Images in AWS S3: 404 Error Not Found - html

I coded up my website with html and css in Dreamweaver. When I open the html documents locally on my computer, the images all load (everywhere, including on the Art/Design page). When I uploaded all of the files to AWS, only three out of the sixteen gallery images loaded (the 7th, 8th, and 9th). For each of the gallery divs, including the images in them, the code is identical. When opened in chrome, developer tools show the images which didn't load cannot be found (404 error). The images do not load through the direct url or my domain. Other images outside of the gallery loaded fine.
Here is the html:
<section id="full-width">
<div class="title2">
<p>Fine Art</p>
</div>
<section id="pictures">
<div class="column">
<div class="gallery">
<img src="Images/Gallery/1.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Study of the Eye</h>
<h1>2016</h1>
<p>Graphite on paper.</p>
</div>
</div>
<div class="gallery">
<img src="Images/Gallery/2.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Study of the Iris</h>
<h1>2016</h1>
<p>Hard pastel on paper</p>
</div>
</div>
... <!--skipping a few elements-->
<!-- The following three images load without fail-->
<img src="Images/Gallery/9.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Fahrenheit 451 Alternate Cover</h>
<h1>2013</h1>
<p>Spray paint on newspaper on canvas</p>
</div>
</div>
</div>
<div class="column">
<div class="gallery">
<img src="Images/Gallery/12.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Glint</h>
<h1>2015</h1>
<p>Acrylic on illustration board</p>
</div>
</div>
<div class="gallery">
<img src="Images/Gallery/10.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Impressionist Self-Portrait</h>
<h1>2015</h1>
<p>Soft-pastel on illustration board.</p>
</div>
</div>
<!-- the following, again, do not load -->
<div class="gallery">
<img src="Images/Gallery/8.jpg" alt="" class="gallery-image">
<div class="title4">
<h>Self-Portrait: Creation</h>
<h1>2016</h1>
<p>Graphite on paper</p>
</div>
</div>
... <!-- skipping more elements -->
</div>
</div>
</div>
I don't understand how some images can load and others cannot. The images which load are not the smallest sized images of the group, and neither is there anything which sets them apart.
Bonus question: why can't my error.html page load the stylesheets? (Again, Chrome claims 404 error, cannot be found)?

Related

How do I link this image in my website to another url using an <a> tag?

I need to link this image in my website to another url but I cannot figure it out. I tried to use an <a> tag but when it deployed, I would click on the link and it still wouldn't redirect me. I'll attach the code below:
<div class="portfolio-item padd-15">
<div class="portfolio-item-inner shadow-dark">
<div class="portfolio-img">
<img src="images/CGS Official Logo 500 × 360 px.png" alt="">
</div>
</div>
</div>
putting the img inside an anchor tag<a> <img> </a>
img {
width: 150px
}
<div class="portfolio-item padd-15">
<div class="portfolio-item-inner shadow-dark">
<div class="portfolio-img">
<a href="https://stackoverflow.com/">
<img src="https://images.unsplash.com/photo-1663668244836-68998f4e9151?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyfHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=500&q=60" alt="">
</a>
</div>
</div>
</div>
To add a link to your img tag surround it with your anchor tags.
See this snippet:
<div class="portfolio-item padd-15">
<div class="portfolio-item-inner shadow-dark">
<div class="portfolio-img">
<a href="https://google.com">
<img src="images/CGS Official Logo 500 × 360 px.png" alt="image">
</a>
</div>
</div>
</div>
I've added alt text so you can see the URL functioning as intended.
W3schools tag

YouTube videos opening unexpectadly and blocking mobile device

This is the html to display 3 videos on the screen. When this is viewed on a mobile device (e.g. Samsung S8), the screen automatically activates.
<div class="row bottom-whitespace">
<div class="col-sm-4">
<figure class="img-tbtext video-icon">
<div class="vid-banner"><img src="../assets/images/video-img1.jpg" class="hover-img">
<div class="lazyOwl"><img src="../assets/images/play-Icon.png"></div>
</div>
<a class="gallery" data-flashy-type="video" href="https://youtu.be/ZfDRNqWfGas" frameborder="0" allowfullscreen=""></a>
<h5>Change, project and task management</h5>
</figure>
</div>
<div class="col-sm-4">
<figure class="img-tbtext video-icon " style="background: #ffc107;">
<div class="vid-banner"><img src="../assets/images/video-img2.jpg" class="hover-img">
<div class="lazyOwl"><img src="../assets/images/play-Icon.png"></div></div>
<a class="gallery" data-flashy-type="video" href="https://youtu.be/MY_CFDnNTzU" frameborder="0" allowfullscreen=""></a>
<h5>Process excellence & waste management</h5>
</figure>
</div>
<div class="col-sm-4">
<figure class="img-tbtext video-icon" style="background: #8bc34a;">
<div class="vid-banner"><img src="../assets/images/video-img3.jpg" class="hover-img"><div class="lazyOwl"><img src="../assets/images/play-Icon.png"></div></div>
<a class="gallery" data-flashy-type="video" href="https://youtu.be/gYfdvWWf1p8" frameborder="0" allowfullscreen=""></a>
<h5>Quality control, Audit and Quality assurance</h5>
</figure>
</div>
</div>
Autoplay Videos
In Safari and some other browsers(mobile), autoplay for videos are prevented and an active input from a user is needed. Safari and Chrome decide that on an algorithm which depends on your browser behaviour:
Safari: https://www.cnet.com/news/wwdc-privacy-high-sierra-safari-blocking/
Chrome: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Can you give us some reproducible code? This way we can check what goes on and maybe find your problem. :)

Angular Firebase scroll issue in chrome due to images

Angular 6: Images takes time to load in chrome
This issue is specifically in chrome and not in any other browser.
We have used Firebase in our project, and used snapshotchange method to fetch the image to angular project from the same, the image urls are like this https://firebasestorage.googleapis.com/v0/b/test-4a5d9.appspot.com/o/download.jpg?alt=media&token=a78321fc-eb9c-496a-a690-e8b2ccddf6c6 . There is something wrong due to which, image loads very slowly and the screen becomes blank when we scroll up and down in the browser, here we have used "ngx-infinite-scroll".
I have also tried by concatenating .jpg extension after the image but the scenario remains the same.
First, I thought the problem is with the size of image which is affecting the loading speed, so then I have replaced the images with https://upload.wikimedia.org/wikipedia/commons/b/b9/Pizigani_1367_Chart_1MB.jpg which is a heavy size of image, but here the website run's smoothly without any issue.
But it does not scroll smoothly when image urls are like this https://firebasestorage.googleapis.com/v0/b/test-4a5d9.appspot.com/o/download.jpg?alt=media&token=a78321fc-eb9c-496a-a690-e8b2ccddf6c6
Here is the code to set images in one list item:
<div class="slider">
<div class="slideshow-container" id="{{works.id}}_" *ngIf="works.media">
<div class="imgSlides imgsss active" *ngIf="works.media.aFront != undefined">
<div class="content">
<div>
<img src="{{works.media.aFront}}" alt="front img" />
</div>
</div>
</div>
<div class="imgSlides imgsss" *ngIf="works.media.bBack != undefined">
<div class="content">
<div>
<img src="{{works.media.bBack}}" alt="back img" />
</div>
</div>
</div>
<div class="imgSlides imgsss" *ngIf="works.media.cLeft != undefined">
<div class="content">
<div>
<img src="{{works.media.cLeft}}" alt="left img" />
</div>
</div>
</div>
<div class="imgSlides imgsss" *ngIf="works.media.dRight != undefined">
<div class="content">
<div>
<img src="{{works.media.dRight}}" alt="right img" />
</div>
</div>
</div>
<div class="imgSlides imgsss" *ngIf="works.media.ePanoroma != undefined">
<div class="content">
<div>
<img src="{{works.media.ePanoroma}}" alt="panoroma img" />
</div>
</div>
</div>
<div class="imgSlides imgsss" *ngIf="works.media.fDetail != undefined">
<div class="content">
<div>
<img src="{{works.media.fDetail}}" alt="detail img" />
</div>
</div>
</div>
<!-- arrow -->
<div *ngIf="works.imageCount>1">
<a class="next arrow-control" (click)="plusSlide(1,works.id + '_')"> <img src="assets/image/backward.png" alt="previous arrow" /> </a>
<a class="prev arrow-control" (click)="plusSlide(-1,works.id + '_')"> <img src="assets/image/forward.png" alt="next arrow" /> </a>
</div>
<p class="sold-btn" *ngIf="works.isSold">{{'Sold'}}</p>
</div>
<div class="slideshow-container" *ngIf="isEmptyObject(works.media)">
<div class="content">
<div [ngStyle]="{'background-image': 'url(' + defaultimg + ')'}" class="img-thumb"></div>
</div>
</div>
<div style="text-align:center;display:none;" class="bullets">
</div>
</div>
Here is the video of the problem:
https://drive.google.com/file/d/1Ipl-34rOE2ZcscF3jrPYw2C9WfgnA29U/view?usp=sharing
Do the images need to be private?
You don't have any caching enabled on your images.
If you check the headers for the image they have Cache-Control: private.
Since the browser isn't allowed to cache the images, it might affect the performance quite a bit.
Potential fix
I would suggest allowing the user to cache the images for at least an hour.
You will need to set the correct cache headers when uploading the images.
But you can easily via googles gsutil set the headers for all files in a folder
This is what I use:
Where in this case we cache the images for 1year and make them immutable causing the browser to always use the cached version
gsutil -m setmeta -h "Cache-Control:public,max-age=31536000,immutable" 'gs://my-storage-bucket-name/myimagefolder/**/*.{jpg,png}'
Hopefully this could make the app more performant, but you will have to try to know.

CSS and <a href> issue

I have a rollover effect over an image which can be seen here: http://www.sdimmigrationlawyers.com/ (bottom of page - deportation image)
I want to add a link to it, but my tag isn't working. How should I implement it to (1) have the rollover effect, and (2) have the link?
CSS:
<div class="view view-sixth">
<img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg">
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<div class="mask"></div>
</a>
<p>
</p>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</div>
HTML:
<div class="paragraph_dui_crime_box2">
<h2>San Diego Deportation Lawyer</h2>
<div class="view view-sixth">
<img class="alignleft wp-image-335 size-full" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg" alt="" />
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<div class="mask"></div>
</a>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</div>
You could try wrapping the <a> tag around the whole section like so :
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg">
<div class="mask"></div>
<p>
</p>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</a>
Your code with the headline "CSS" is HTML, so I assume it's what's the HTML-code of your page.
If you haven't any restrictions in HTML-markup, do the following and make sure that the DIV with the h2 is wrapped in an anchor leading somewhere:
<a href="...">
<div class="content"><h2>Deportation Defense</h2></div>
</a>
Currently, your anchor surrounds something with no content (that is not clickable), the content on the other side is not properly wrapped in an anchor (so it's neither clickable).

Bootstrap img src not loading images from local hard drive

I am facing an amazing problem that my html program loads images from web but not from local hard drive. I tried alot by changing path and folder but still the issue is same.
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<figure>
<img src="/images/img.jpg"
alt="Ghoomo Phiro Pakistan Adventure Club">
</figure>
<div class="caption">
EveryThing goes there
</div>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<a href="#" class="thumbnail">
<img src="https://www.google.com/images/srpr/logo3w.png"
alt="Ghoomo Phiro Pakistan Adventure Club">
</a>
<div class="caption">
EveryThing goes there
</div>
</div>
</div>
Why does this work:
<img class="img-thumbnail img-responsive"
src="http://upload.wikimedia.org/wikipedia/sr/0/0c/Firefox-logo.png"
alt="" />
But not local images:
<img class="img-thumbnail img-responsive"
src="http://localhost/live/images/logo.png"
alt="" />
If you use src="/images/fileName" then the browser looks for images folder in the root directory. If images folder is in the same working directory then it won't work. You must have to replace it with either ./images/fileName or images/fileName
Check to see if your image is in one directory, and your css file in another. If this is the case, your css file will not be able to access the image without first going up the in the directory like so:
<img src="../images/img.jpg"
I did it when my image moved from assets/images to views/* or public. Also you can use image_tag Rails helper.