rgpages / rgpages.github.io

This page was created and is cared for by The Register-Guard web team to curate special online presentations of static stories. Additionally, it houses open-source story templates.
http://pages.registerguard.com/
0 stars 0 forks source link

lane-county-fair - file size #8

Closed robertdenton closed 10 years ago

robertdenton commented 10 years ago

The Lane County Fair repo is weighing in at a hefty 65 MB and crashing mobile browsers especially Facebook and Twitter.

Need to look into displaying lower res photos (and maybe audio? don't know if that's possible...) on mobile.

mhulse commented 10 years ago

For audio files, I've reduced size: https://github.com/rgpages/lane-county-fair/issues/13

Might not hurt to play with image compression a tad? Or not worry about it for this project, but remember these issues for the next project that's similar. :+1:

robertdenton commented 10 years ago

Mobile file size research:

mhulse commented 10 years ago

Here's what I've done in the past: https://github.com/mhulse/vogue

Probably other/better techniques … Like this one (maybe):

https://github.com/scottjehl/picturefill

robertdenton commented 10 years ago

:+1:

robertdenton commented 10 years ago

Conclusion: Will try out SoundCloud player with image or other tried and true methods in the future. Don't want to completely rule out HTML5 video/audio and high-res pics but may not be the best in every situation.

In future projects may want to plan for mobile first with smaller files and move up from there. Possibly use above methods including picturefill or vogue.

robertdenton commented 10 years ago

Grunt responsive images

package.json

Gruntfile.js

responsive_images: {
    dev:{
        options: {
            sizes: [
                {
                    name: 'small',
                    width: 400,
                }, 
                {
                    name: 'medium',
                    width: 800,
                },
            ],
        },
        files: [
            {
                expand: true,
                src: ['images/*.{gif, jpg, png}'],
                cwd: './files/',
                dest: '../dev/',
            },
        ],
    },
},