aboutsummaryrefslogtreecommitdiffstats
path: root/util/storageconv
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-06-10 19:49:34 +0000
committerMario <mario@mariovavti.com>2019-06-10 22:35:14 +0200
commit86929775852897d5282b334161e489050f1c55ae (patch)
tree698c0860ef483747118cdb80489ddd696cf55783 /util/storageconv
parent6a40f3ed60d14cc7fe0c4b2a66cff33ceb472f7f (diff)
downloadvolse-hubzilla-86929775852897d5282b334161e489050f1c55ae.tar.gz
volse-hubzilla-86929775852897d5282b334161e489050f1c55ae.tar.bz2
volse-hubzilla-86929775852897d5282b334161e489050f1c55ae.zip
fix storageconv issue with postgres
(cherry picked from commit 0e2239e50b6a4da8261a03284211d989c87f50e2)
Diffstat (limited to 'util/storageconv')
-rwxr-xr-xutil/storageconv7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/storageconv b/util/storageconv
index 9c49787d1..c4d981531 100755
--- a/util/storageconv
+++ b/util/storageconv
@@ -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;