Hey all,
I'm trying to add dynamically generated Google Chart Image to image field, but... it doesn't work
$imgSrc = 'https://chart.googleapis.com/chart?chs=920x200&cht=bvs&chd=t:0,7,0,0,4,0,0,0,0,0,0,1,0,0,0,1,2,0,0,0,7,11,4,0,3,4,2,4,6,1&chds=a&chm=B,eeeeee,0,0,0&chls=3&chco=222222'
$page->images->add($imgSrc);
It fails with 'Exception: Unable to copy: ' and adds a bunch of data.
I've got two questions: How can I affect the filename of the file created [thus add some extension, for instance it's PNG file]. And more importantly, why doesn't this work? I know for a fact that URL adding works.
Edit: Actually, this is how I save this:
$page->images->removeAll();
$page->images->add($commitsGraphSrc); //it's an URL for google chart API
$page->images->add($languagesGraphSrc); //another URL for gchart API
$page->save();