stefanjudis / grunt-photobox

Grunt plugin for creating screenshots of any site and compare them
MIT License
277 stars 22 forks source link

Colon in filenames #28

Open AdamBoman opened 10 years ago

AdamBoman commented 10 years ago

There appears to be an issue when the URL contains a colon, such as "http://localhost:8888/". The colon remains in the filename and in the command line parameters to ImageMagick. This causes problems, at least on Windows.

PHOTOBOX STARTED PHOTO SESSION.
started photo session for http://localhost:8888/#960
>> picture of http://localhost:8888/#960 taken.
>> PHOTOBOX FINISHED PHOTO SESSION SUCCESSFULLY.

NOTE: You defined to use ImageMagick, make sure it is installed.

PHOTOBOX STARTED DIFF GENERATION.
started diff for localhost:8888--960
>> Error: composite.EXE: unable to open image `8888--960.png': No such file or directory @ error/blob.c/OpenBlob/2657.
>> composite.EXE: unable to open file `8888--960.png' @ error/png.c/ReadPNGImage/4021.
>> composite.EXE: unable to open image `8888--960.png': No such file or directory @ error/blob.c/OpenBlob/2657.
>> composite.EXE: unable to open file `8888--960.png' @ error/png.c/ReadPNGImage/4021.
>> composite.EXE: missing an image filename `photobox/img/diff/localhost:8888--960-diff.png' @ error/composite.c/CompositeImageCommand/1613.
>> Error: convert.EXE: unable to open image `8888--960-diff.png': No such file or directory @ error/blob.c/OpenBlob/2657.
>> convert.EXE: unable to open file `8888--960-diff.png' @ error/png.c/ReadPNGImage/4021.
>> convert.EXE: no images defined `photobox/img/diff/localhost:8888--960.png' @ error/convert.c/ConvertImageCommand/3187.
>> PHOTOBOX FINISHED DIFF GENERATION SUCCESSFULLY.

PHOTOBOX STARTED INDEX FILE GENERATION
>> PHOTOBOX CREATED NEW 'index.html' AT 'photobox/'.
AdamBoman commented 10 years ago

Adding the code

.replace( /:/g, '-')

to tasks/lib/photobox.js line 86, tasks/lib/photoboxScript.js line 69 and tasks/tpl/magic.tpl line 199 solved the issue for me.

stefanjudis commented 10 years ago

Hey, ja well...

The solution is really not good, I took in first place. Should be refactored anyway. But if you would propose PR I could check it on the weekend. :)