SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    two images or one

    Hello,
    When using the same web page for both the desktop and mobile version, should I create two images, one for the desktop and one for mobile, or should I just have one image, and then resize it using PHP for the mobile version? And how does that affect the size (in bytes) of the image file?

    Thanks

  2. #2
    I Use MODx kenquad's Avatar
    Join Date
    Dec 2009
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CathyM View Post
    Hello,
    When using the same web page for both the desktop and mobile version, should I create two images, one for the desktop and one for mobile, or should I just have one image, and then resize it using PHP for the mobile version?
    I would create two images. Resizing with PHP on every view adds server overhead. (You could of course write a script to resize each image only once and store the resized version separately until the original was modified again.)

    And how does that affect the size (in bytes) of the image file?
    Not sure I understand the question. If you're asking how dimensions affect image file size, the answer is plenty - but exactly how much depends on the original size and the target size.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just create 2 images. That will be faster.

    Resizing the images can have a big effect. It depends on how much you resize it and on the speed of the internet connection that you are using.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •