Website images do not appear on iphone or iOS tablet

Asked

Viewed 1,885 times

2

On the website: http://viladivanomoveis.com.br/? page=products&prod=Armchairs images do not appear when accessing from iphones or ipads, I suspect it is because of this php code that resizes the original image:

<a href="?page=item&prod=<?php echo remover($exeprod['produto']);?>">
 <img src="thumb.php?img=admin/<?php echo $spr[0];?>&x=300&y=300&q=80" alt="" title=""/>
</a>

Does anyone know how to make the images appear or why they don’t appear?

  • The images appear for a brief moment and then disappear... To confirm the suspicion, change the src to link directly to the image. The inspector of Safari accuses no JS error, only a 404 to http://viladivanomoveis.com.br/get-tweets.php?url=undefined

  • I’ve had problems if similar and was why the original images were in 32 bits color CMYK and not 24 bits RGB, check this out...

  • I’m sorry, I don’t understand... what I put in place of 'src'?

  • @Jader I checked, the images are in 'png 8bits RGB'

  • <img src="LINK-REAL-DA-IMAGEM.jpg"> . . . I guess you’ll have to investigate what that thumb.php do, check out How to debug code in PHP?

2 answers

1

The reason they don’t appear is that the file that should be a src image (a jpg,png, gif or something like that) is a . php (Thumb.php). The device browser does not "accept" loading a php as an image... what you can do is rename the Thumb.php file to Thumb.jpg for example. So the browser will accept to display your content as image.

Or...

Call a method that returns the full image url, and fill in this value in src.

1

Make sure your PHP is sending the mime-type correct in the images:

<?php

   header("Content-type: image/png");
   ...

The type is necessary for browsers to know what that information is being served.

Usually the server sends the correct type when dealing with static files, but when you generate your file, it is necessary to "warn" the browsers.

When it comes to generating HTML by PHP this is not necessary, because PHP itself already sends the mime-type html default.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.