songlibo / pagespeed-chrome-extension

Apache License 2.0
44 stars 12 forks source link

[Feature Request] Bulk download all "Optimized Images" #7

Open olokoo opened 8 years ago

olokoo commented 8 years ago

When using the tool, you can view the optimized image. You can then download them, but they have odd randomly generated names.

It would be awesome if it would allow you to download all the images at once, with their original file names, maybe in a ZIP folder?

Thanks!

songlibo commented 8 years ago

The odd randomly generated names it to avoid conflict because images can be from different hosts, different folders to have the same file name.

Suggestions on how avoid file name collisions are welcome.

olokoo commented 8 years ago

@songlibo Hmm, perhaps checking the directory path and creating separate folders in the ZIP folder?

So if the path is http://mysite.com/images/picture1.jpg it would stick it in the folder "mysite-com-images".

And if the path is http://yoursite.com/images/picture1.jpg it would stick it in the folder "yoursite-com-images".

And if the path is "http://yoursite.com/annotherdir/picture1.jpg" it would stick it in the folder "yoursite-com-annotherdir"

Or you could use deeper nested folders like "mysite-com/the-dir-the-image-is-in/theimage.jpg"

Just ideas, also for a simpler method, that I personally would be fine with, would be to just have the user be able to select if they want the original name, and if a duplicate, could just add a suffix to the name like it is currently doing it.

Either method is fine by me, but I feel some sort of nested directory download would be optimal and even possibly the ability to select which hosts to pull from. For example, if I am pulling images from http://google.com, I may not need/want to download their optimized images.

Thanks for the reply.