]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Generally applying 0644 on all thumbnail images is maybe not what all people
authorRoland Haeder <roland@mxchange.org>
Mon, 23 Feb 2015 18:57:00 +0000 (19:57 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 23 Feb 2015 18:59:44 +0000 (19:59 +0100)
like, so better make it configurable.

Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/default.php
lib/imagefile.php

index 6d6677f2872de15232f448b9b835259536db160e..987c9bd6395fd7d9d1b9ba50ec2eca4a7f35cb5f 100644 (file)
@@ -256,6 +256,7 @@ $default =
               ),
         'thumbnail' =>
         array('crop' => false,      // overridden to true if thumb height === null
+              'chmod' => 0644,       // Access rights (chmod) for created thumbnail images
               'maxsize' => 1000,     // thumbs with an edge larger than this will not be generated
               'width' => 450,
               'height' => 600,
index d040a4b270309c6d41fce33c43ce2f7e91db0623..80cd9023cd8f2bbbf8a821630ee5f001fc9c3c97 100644 (file)
@@ -253,6 +253,9 @@ class ImageFile
             if ($this->rotate == 0) {
                 // No rotational difference, just copy it as-is
                 @copy($this->filepath, $outpath);
+
+                // And set chmod
+                @chmod($outpath, common_config('thumbnail', 'chmod');
                 return $outpath;
             } elseif (abs($this->rotate) == 90) {
                 // Box is rotated 90 degrees in either direction,
@@ -351,8 +354,8 @@ class ImageFile
             throw new Exception(_('Unknown file type'));
         }
 
-        // Always chmod 0644 to have other processes (e.g. queue daemon read it)
-        @chmod($outpath, 0644);
+        // Always chmod 0644 (default) to have other processes (e.g. queue daemon read it)
+        @chmod($outpath, common_config('thumbnail', 'chmod');
 
         imagedestroy($image_src);
         imagedestroy($image_dest);