samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Newly uploaded images getting permission 600 instead of 644 #413

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've been having problems with uploading images to the site. It appears the 
files and thumbnails are being create but with permissions set to 600. And of 
course they're not displaying but my old images are.

If I manually change the permissions of the new images to 644, they seem to 
appear correctly.

I tracked down function chmod in functions.php, and changing this line:
if ( @chmod($filename, $perms) )
to this
if ( @chmod($filename, 0644) )
fixes the problem.

I am using wordpress 3.2.1, NextGEN Gallery 1.8.3, PHP 5.3.6 on A2 Hosting's 
Executive Shared plan.

I've seen other people describe the same symptoms with no resolution, so I'm 
sure the problem is not directly related to my setup. Those symptoms being - 
images appear to upload properly, but thumbnails do not appear. But if you 
chose to edit the thumbnail, you will see the photo during editing. Managing 
the gallery shows entries for the images but no thumbnail to the left. Viewing 
the image itself yields a not found in wordpress. 

Original issue reported on code.google.com by matthewd...@gmail.com on 28 Aug 2011 at 6:47

GoogleCodeExporter commented 8 years ago
Try to change it in this way (see attached patch) :

$stat = @ stat( dirname($filename) );
$perms = $stat['mode'] & 0000666;
if ( @chmod($filename, $perms) )
    return true;

have this piece of code a long long time, never revisited it, but it should be 
enough to try to set the 0666 permission.

Original comment by alex.cologne on 11 Sep 2011 at 5:15

Attachments:

GoogleCodeExporter commented 8 years ago
Have you time to test my patch ?

Original comment by alex.cologne on 18 Sep 2011 at 8:06

GoogleCodeExporter commented 8 years ago
Been busy. Just tried it and the same result - they still get permissions 0600. 
What is interesting is that if I click Edit Thumb, I can see the picture. And 
if I delete the picture, the actual image remains in the folder on the server 
but the image for the thumb (which also has 0600 permission) gets deleted. 

Original comment by matthewd...@gmail.com on 18 Sep 2011 at 4:59

GoogleCodeExporter commented 8 years ago
Also, I really don't know much about php; but I replaced the entire contents of 
that function with simply return true. The images upload and have 644 and 
thumbs get generated. 

Original comment by matthewd...@gmail.com on 18 Sep 2011 at 5:09

GoogleCodeExporter commented 8 years ago
Found php has echo statement so here are the variables. 
$stat['mode']: 16841 
$perms: 384 

Original comment by matthewd...@gmail.com on 18 Sep 2011 at 5:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Having the same problem. Tried the patch, but not only it didn't work, even the 
upload got broken ("0 images upload message"). Then I replaced the content of 
the function with a simple "return true" and the problem got resolved. 

Original comment by nicolasg...@sitio54.com.ar on 15 Nov 2011 at 3:14

GoogleCodeExporter commented 8 years ago
Having the same problem with current NextGEN-Gallery version 1.9.3. I did not 
try to apply any patch yet. Why doesn't it work out of the box anymore? However 
I do not know whether it would work with another webspace provider. I'm 
currently using domainFactory Homepage Plus package.

The single images are uploaded via the plugin and seem to be stored with 
permission 600 but only 640 would work. The same is true for the thumbnails.

Please fix this! Thanks very much in advance,

Dennis

Original comment by thecondo...@googlemail.com on 7 Apr 2012 at 3:53

GoogleCodeExporter commented 8 years ago
Well, I've tried the trick with always returning TRUE in the function chmod in 
admin/functions.php file of NGG. But this did not solve the problem. The 
preview pictures and full size pictures uploaded with NGG always became 600 
(access denied for group and others).

After some searching in the domainFactory forum I found THE solution (for now). 
Regarding at least the domainFactory settings: ALL the directories (recursively 
up) that shall have 644 files automatically created in them must have the 
permissions 750 and not 710! This way, new files created inside them will 
automatically get 640 instead of 600. It works!

I have not checked yet creating new galleries und uploading into them though.

Anyway, maybe this helps some people.

Regards,

Dennis

Original comment by thecondo...@googlemail.com on 27 Apr 2012 at 7:57

GoogleCodeExporter commented 8 years ago
I want to code one PHP script which allows me to generate thumbs of given 
images with specified dimensions and names as per Next-Gen Gallery Plugin of 
Wordpress.

I have website for cover pages: http://facebook4free.com/

Thumb Gallery Page: 
http://facebook4free.com/category/facebook-cover-pages/abstract-facebook-cover-p
ages-facebook-cover-pages/

Main Image Page: 
http://facebook4free.com/abstract-cover-pages-for-facebook-profile-2/facebook-im
ages/image/1-cover-photo-82140/ 

Issue is timeout when I upload images in wordpress plugin. It uploads images in 
create their thumbs but when I upload more than 10 images it fails. So I want 
to separately create PHP script which create thumbnails of my FB cover pages 
with given dimensions and specified name (a pattern).
Many of the images are in .jpg, .png formats but all are having dimensions of 
851x315. 
Any help would be appreciated.

Original comment by ashishre...@gmail.com on 24 Mar 2013 at 7:12

GoogleCodeExporter commented 8 years ago
Problem is still there with Wordpress version 3.5.1 and Nextgen 1.9.1, 
permission by default still are at 640 instead of 644.

Original comment by hero...@gmail.com on 19 Apr 2013 at 1:31

GoogleCodeExporter commented 8 years ago
Problem is still there with Wordpress version 3.6.1 and Nextgen 2.0.31, 
permission by default still are at 600 instead of 644.

Original comment by garsc...@gmail.com on 5 Oct 2013 at 12:04

GoogleCodeExporter commented 8 years ago
I have the same problem.

Original comment by anderson...@gmail.com on 30 Aug 2014 at 6:39

GoogleCodeExporter commented 8 years ago
also confirm this, and do not know how to solve it permanently, for now I have 
cron every 5 minutes:

*/5 * * * * chmod -R 655 /path/to/wordpress/wp-content/gallery

Original comment by vl.bed...@gmail.com on 9 Oct 2014 at 6:46

GoogleCodeExporter commented 8 years ago
I have the same problem.

Original comment by diegoaul...@gmail.com on 30 Jan 2015 at 12:09

GoogleCodeExporter commented 8 years ago
me also

Original comment by cubric.s...@gmail.com on 23 May 2015 at 11:50