PhotoDune

Posts by Pirenko

399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says


To avoid that caching issue why don’t we use a PHP session for that? Each time a retina device opens the page a session is created setting a PHP variable to true. This should fix that, right? I’m currently coding a solution with sessions that seems to be working…
you can’t detect retina via php
I know, but it would be so easy if we could :)
My idea at this moment is:
1) Page loads and with javascript we check if it’s a retina display.
2.a) No retina display and the pages loads normally;
2.b) Argh! It’s a retina display! We create a PHP session and store a PHP variable saying that. The next time the page loads we have this variable on the header and we can add classes to images or resize them accordingly.
399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

To avoid that caching issue why don’t we use a PHP session for that? Each time a retina device opens the page a session is created setting a PHP variable to true. This should fix that, right? I’m currently coding a solution with sessions that seems to be working…

399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

@Pirenko Yes, you’re right. Static images embedded by authors which are not thumbnails or sliders or galleries or whatever you make for them will not be retina ready. You can’t have a perfect solution..
Thanks. I’m still searching for a “perfect solution”, but this seems to be the better a approach now. Thank you all for your valuable inputs :nerdy:
399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says



No, HiRes images will be served only when retina display is detected. Retina display will be detected using javascript, when detected a cookie will be generated then you can use php conditional statement to check the existence of this cookie, if it’s existing then generate image with x2 size (using one of the available image resizing scripts/technics) otherwise generate image with normal size. But to be sure that the x2 size will look sharp you need to upload already big images to the WP media library.
This starts to make sense now, but I see a problem… Let’s grab an example: the theme logo. The user has to upload it in the size he wants it to be displayed (instead of a larger size to be shrinked) so how will you handle these cases? The cases on where the image maximum size is the size you want to use on the frontend?
The logo is a different story. Just provide the user the option to upload 2 logos and specify the width of the small logo, then do the switch in CSS. The logo is an exception from what i’ve wrote earlier..
Ok, Thanks! This makes sense, but there will still be trouble with other type of images across the website (ex. on static pages where the user wants to show a “static” image).
Final question if someone still can stand the pain: for the logo example is it enough to provide a simple image that has 144 ppi and provide it on the original dimensions on all screen types?
399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

No, HiRes images will be served only when retina display is detected. Retina display will be detected using javascript, when detected a cookie will be generated then you can use php conditional statement to check the existence of this cookie, if it’s existing then generate image with x2 size (using one of the available image resizing scripts/technics) otherwise generate image with normal size. But to be sure that the x2 size will look sharp you need to upload already big images to the WP media library.
This starts to make sense now, but I see a problem… Let’s grab an example: the theme logo. The user has to upload it in the size he wants it to be displayed (instead of a larger size to be shrinked) so how will you handle these cases? The cases on where the image maximum size is the size you want to use on the frontend?
399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

I’m sorry to ask again, but can someone clarify if according to RubenBristian and Enabled method will the normal screens will be served with those high res images too? If this is true it seems to be a poor solution in terms of bandwidth usage…

399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says
You need to server “retina images” only for retina displays. There’s no need to double everything on the site! You can simply check if the user is on a retina display with js, store this with a cookie and server double images via an image resizing plugin..
Sorry if I was unclear… I was talking about the method above suggested by RubenBristian.
399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

But, according to this method, we have to upload only high res images, right? If this is correct, will the normal screens will be served with those high res images too?

399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

Great stuff! Waiting for this log time ago… Thanks :nerdy:

399 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Europe
Pirenko says

This might sound a bit dumb, but did you activate the child theme?

by
by
by
by
by