printdotio / pio.js

An embeddable widget that enables users to quickly and easily monetize a webpage by enabling photo-product sales of its images.
4 stars 0 forks source link

Using thumbnails for faster loading #20

Open fromkeith opened 10 years ago

fromkeith commented 10 years ago

Would it be possible to provide thumbnails when creating the PIO.open object?

If I have 100 images, each 2-5MB, it can take a long time for a slow connection to load the images. Scrolling through the list also appears to be laggy with that many photos. (Also, the browser memory usage spikes... but that's expected with that many large images loaded into memory). However, I already have thumbnails created for these images, each < 1MB. Showing these in the Photo Collection would greatly improve the responsiveness and load time.

Would it be possible to load these thumbnails in the widget, instead of the full images?

Eg.

PIO.open({
    images: [
        {full: 'full.jpg', thumb: 'small.jpg'},
        {full: 'anotherBigPicture.jpg'', thumb: 'smallerViewable.jpg'}
    ]
})

This way, you still get the full image you need printing and any other calculations. While the small thumbnails can be used inside the widget, to make it more responsive, and faster to load. You can also lazy load the full images for when you need them inside the widget, like editing, or previewing a print. You can use type checking of each item in the image list to support backwards compatibility.

Thanks.

micahasmith commented 10 years ago

@fromkeith this is a great idea. going to add it to the todos

ocram commented 9 years ago

+1 Supporting this issue