Commit 0e2239e5 authored by Mario's avatar Mario

fix storageconv issue with postgres

parent 55792d55
......@@ -46,7 +46,7 @@ if($argc == 2) {
}
$x = q("SELECT DISTINCT resource_id, content FROM photo WHERE photo_usage = 0 AND os_storage = 1 AND imgscale = 0");
if($x) {
foreach($x as $xx) {
......@@ -54,12 +54,15 @@ if($argc == 2) {
dbesc($xx['resource_id']),
$storage
);
$img_path = dbunescbin($xx['content']);
foreach($n as $nn) {
echo '.';
$filename = dbunescbin($xx['content']) . '-' . $nn['imgscale'];
$filename = $img_path . '-' . $nn['imgscale'];
if(! file_put_contents($filename, dbunescbin($nn['content']))) {
echo 'Failed to save file ' . $filename . PHP_EOL;
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment