core icon indicating copy to clipboard operation
core copied to clipboard

File App Picture Preview shows only File Icon

Open Do-D opened this issue 12 years ago • 20 comments

Hi,

Im on Owncloud 7.0.2.1 via .deb Package. When I try to view a Picture, I only get the Icon displayed: oc1 oc2 File Preview is disabled so the Icon in the list is okay, but when i klick the picture it should show the actual fullsize picture? This also happens when I share a picture, but everything works fine if I use the Pictures App.

Steps to reproduce

  1. Upload a Picture
  2. View Picture in File App

Expected behaviour

File Preview should show the Picture.

Server configuration

Operating system: Ubuntu 14.04.1 LTS Web server: Nginx 1.4.6 (Ubuntu) Database: Mysql 5.5.38 PHP version: 5.5.9 ownCloud version: (see ownCloud admin page) ownCloud 7.0.2 (stable) Updated from an older ownCloud or fresh install: Update from 7.0.1 List of activated apps: Activity, Deleted Files, PDF Viewer, Pictures, Share Files, Video Viewer The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'XX',
  'passwordsalt' => 'XX',
  'trusted_domains' =>
  array (
    0 => 'XX.XX',
  ),
  'datadirectory' => '/mnt/oc-data',
  'dbtype' => 'mysql',
  'version' => '7.0.2.1',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'XX',
  'installed' => true,
  'forcessl' => true,
  'enable_previews' => false,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'owncloud',
  'mail_domain' => 'XX',
  'mail_smtphost' => 'XX',
  'logfile' => '/var/log/owncloud/owncloud.log',
  'loglevel' => '0',
  'logtimezone' => 'Europe/Vienna',
  'log_type' => 'owncloud',
  'log_authfailip' => true,
  'check_for_working_htaccess' => false,
  'check_for_working_webdav' => false,
  'has_internet_connection' => true,
  'appstoreenabled' => false,
  'updatechecker' => false,
  'theme' => '',
  'maintenance' => false,
  'skeletondirectory' => '',
);

Are you using external storage, if yes which one: local/smb/sftp/... oC Data is on a second HDD (locally mounted) on the server.. Are you using encryption: yes/no NO

Client configuration

Browser: FF 31.0, happens with other Browsers too Operating system: Win 7

Logs

Web server error log

No Error Log

ownCloud log (data/owncloud.log)

I uploaded a new Image and tried to view it in File App

Debug   core    OC_Image->fixOrientation() Orientation: -1  2014-09-01T11:38:09+02:00
Debug   core    OC_Image->loadFromBase64, couldn't load     2014-09-01T11:38:09+02:00
Debug   core    Generating preview for "/photos/Penguins.jpg" with "OC\Preview\Unknown"     2014-09-01T11:38:09+02:00 

Any Ideas?

Do-D avatar Sep 01 '14 09:09 Do-D

Hmmm, please try manually deleting the "thumbnails" and "gallery" folders inside the user's data directory and also clear the browser cache. Since you're coming from 7.0.1, there was a bug with thumbnails so we need to force regenerating them.

CC @georgehrke

PVince81 avatar Sep 01 '14 12:09 PVince81

Thanks, I did that for my user, there was no effect except in the pictures app it took a few seconds to reload all pictures. I created a new user but its the same.

Can I post any other logfile or do something to help finding the failure? edit: This is my Nginx access.log, there is no error.log

11.22.33.44 - - [02/Sep/2014:08:24:50 +0200] "GET /index.php/apps/files/ajax/list.php?dir=%2Fphotos&sort=name&sortdirection=asc HTTP/1.1" 200 366 "https://xx.xx/index.php/apps/files/?dir=%2Fphotos" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
11.22.33.44 - - [02/Sep/2014:08:24:51 +0200] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2Fphotos HTTP/1.1" 200 154 "https://xx.xx/index.php/apps/files/?dir=%2Fphotos" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
11.22.33.44 - - [02/Sep/2014:08:24:52 +0200] "GET /index.php/core/preview.png?file=%2Fphotos%2Fparis.jpg&x=1701&y=930&a=true&scalingup=0 HTTP/1.1" 200 937 "https://xx.xx/index.php/apps/files/?dir=%2Fphotos" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"
11.22.33.44 - - [02/Sep/2014:08:24:52 +0200] "GET /index.php/core/preview.png?file=%2Fphotos%2FPenguins.jpg&x=1701&y=930&a=true&scalingup=0 HTTP/1.1" 200 937 "https://xx.xx/index.php/apps/files/?dir=%2Fphotos" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0"

Do-D avatar Sep 02 '14 06:09 Do-D

Can you try opening /index.php/core/preview.png?file=%2Fphotos%2FPenguins.jpg&x=1701&y=930&a=true&scalingup=0` directly in the browser ? You should see the preview picture.

If you still see a file icon then something might be wrong in the preview creation code and triggered by your setup somehow.

CC @georgehrke

PVince81 avatar Sep 02 '14 08:09 PVince81

Can you try to get more information about the gd and imagick versions and supported formats on your system.

Thx

georgehrke avatar Sep 02 '14 09:09 georgehrke

@PVince81 You are right if i open /index.php/core/preview.png?file=%2Fphotos%2FPenguins.jpg&x=1701&y=930&a=true&scalingup=0 i see the same icon file direct in the browser

Do you think it's a problem with Nginx and my nginx.conf?

@georgehrke Is this the information you need? (output from php -i)

gd

GD Support => enabled
GD Version => 2.1.1-dev
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.5.2
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.2.50
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0
-----------------------------------------------------------------
imagick module => enabled
imagick module version => 3.1.2
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version => ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
ImageMagick copyright => Copyright (C) 1999-2012 ImageMagick Studio LLC
ImageMagick release date => 2014-03-06
ImageMagick number of supported formats:  => 204
ImageMagick supported formats => 3FR, A, AAI, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BIE, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FRACTAL, FTS, G, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, J2C, J2K, JBG, JBIG, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MAT, MATTE, MEF, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive => Local Value => Master Value
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0

Thx for your help!

Do-D avatar Sep 02 '14 09:09 Do-D

@georgehrke Is this the information you need? (output from php -i)

@Do-D Yes. The output looks good. Looking at it, previews should work just fine.

Do you think it's a problem with Nginx and my nginx.conf?

I guess so

georgehrke avatar Sep 02 '14 10:09 georgehrke

okay, this is my nginx default site (it's based on the owncloud 7 docu) and nginx.conf
Maybe someone notice a failure, I already tried to disable some options but none did change anything viewing pictures.

server {
        listen 80;
        listen [::]:80;
        server_name xx.xx;
        return 301 https://$server_name$request_uri;
}

server{
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name xx.xx;
        ssl_certificate /etc/nginx/certs/public.cer;
        ssl_certificate_key /etc/nginx/certs/private_key.key;
        ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
        ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-$
        ssl_prefer_server_ciphers on;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
        add_header Strict-Transport-Security max-age=31536000;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;

        # Path to the root of your installation
        root /var/www/owncloud/;

        client_max_body_size 10G; # set max upload size
        fastcgi_buffers 64 4K;

        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

        index index.php;
        error_page 403 /core/templates/403.php;
        error_page 404 /core/templates/404.php;

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
        location = /favicon.ico { access_log off; log_not_found off; expires 30d; try_files /fa$
        location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
                deny all;
        }

        location / {
                # The following 2 rules are only needed with webfinger
                rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
                rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

                rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
                rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

                rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

                try_files $uri $uri/ index.php;
        }

        location ~ \.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS on;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_send_timeout 600s;
                fastcgi_read_timeout 600s;
                fastcgi_connect_timeout 600s;
                fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
        }

        # Optional: set long EXPIRES header on static assets
        location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires 30d;
                # Optional: Don't log access to assets
                access_log off;
        }

        location ^~ /data {
        internal;
        # Set 'alias' if not using the default 'datadirectory'
        alias /mnt/oc-data;

        #    LOCAL-MOUNT-NAME should match "Folder name" and 'alias' value should match "Config$
        #    A 'Local' External Storage Mountpoint available to a single user
        #    location /data/USER/files/LOCAL-FS-MOUNT-NAME {
        #        alias /path/to/local-mountpoint;
        #    }

        #    A 'Local' External Storage Mountpoint available to mulitple users
        #    location ~ ^/data/(?:USER1|USER2)/files/LOCAL-FS-MOUNT-NAME/(.+)$ {
        #        alias /path/to/local-mountpoint/$1;
        #    }

        #    A 'Local' External Storage Mountpoint available to all users
        #    location ~ ^/data/[^/]+/files/LOCAL-FS-MOUNT-NAME/(.+)$ {
        #        alias /path/to/local-mountpoint/$1;
        #    }

        }
}

/etc/nginx/nginx.conf

user www-data;
worker_processes 2;
pid /run/nginx.pid;

events {
        worker_connections 1024;
        multi_accept on;
        use epoll;
}
http {
        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 70;
        keepalive_requests 200;
        reset_timedout_connection on;
        types_hash_max_size 2048;
        server_tokens off;

        open_file_cache max=5000 inactive=20s;
        open_file_cache_valid 60s;
        open_file_cache_min_uses 2;
        open_file_cache_errors on;

        client_body_buffer_size 128K;
        client_header_buffer_size 1k;
        client_max_body_size 2m;
        large_client_header_buffers 2 1k;

        add_header  X-Content-Type-Options "nosniff";
        add_header  X-Frame-Options "DENY";

        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        ##
        # Logging Settings
        ##
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
        ##
        # Gzip Settings
        ##
        gzip on;
        gzip_disable "msie6";
        gzip_min_length 512;
        gzip_comp_level 2;
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
        ##
        # Virtual Host Configs
        ##
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

Do-D avatar Sep 02 '14 12:09 Do-D

Hi to everybody.

I use apache2 in a Raspberry pi. And I have the same issue.

I try to add file's info, and specs, as soon as posible.

Regards Ch.

rodriguezchema avatar Sep 02 '14 15:09 rodriguezchema

Hi to everybody, Hi to everybody, excuse the delay. This is my system info. Do you need something more?

Server configuration

Operating system:

Raspbian (Debian Wheez)

Web server:

Server version: Apache/2.2.22 (Debian) Server built: Jul 24 2014 21:45:57

Database:

SQL Lite

PHP version:

with php -v..... PHP 5.4.4-14+deb7u14 (cli) (built: Aug 21 2014 19:02:11) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

ownCloud version: (see ownCloud admin page)

ownCloud 7.0.2 (stable)

Updated from an older ownCloud or fresh install:

Update from 6.0.4>>7.0.0>>7.0.1

List of activated apps:

Deleted Files, First Run Wizard, Pictures, Share Files

The content of config/config.php:

'xxx', 'passwordsalt' => 'xxx', 'trusted_domains' => array ( 0 => 'xxx', 1 => '192.168.1.2', ), 'datadirectory' => '/media/hdd1/owncloud/data', 'dbtype' => 'sqlite3', 'version' => '7.0.2.1', 'installed' => true, 'forcessl' => true, 'theme' => '', 'maintenance' => false, 'preview_max_x' => 800, 'preview_max_y' => 800, 'enable_previews' => false, 'overwritewebroot' => '/owncloud', ); Are you using external storage, if yes which one: oC Data is on a usb HDD (locally mounted) on the server. Are you using encryption: yes/no NO ##Client configuration ### Browser: Chrome, happens with other Browsers too Operating system: Win 7, Lubuntu 14.04 ## Logs Web server error log No Error Log

rodriguezchema avatar Sep 03 '14 08:09 rodriguezchema

@rodriguezchema thanks for the info. The more info we get, the closer we can get to fixing the issue.

In your case I see that you set "enable_previews" to false in the config.php. You need to set it to true, else it will not generate previews.

PVince81 avatar Sep 03 '14 08:09 PVince81

Hi @PVince81,

I have "enable_previews" to false, because I don't want generate previews for thumbnails(like @Do-D, I think ).

When we(at least I) set enable previews to false, we don't expect see the image in a list but we expect see the image when we do a click on the icon. I expect the same situation on older version(6.0.4).

I have a duplicated enviroment, with ownCloud versions 7.0.2 and 6.0.4. In both enviroments I disabled previews generation ('enable_previews' => false). In version 6.0.4 when I click in the default icon for an image(becouse preview is not generated) system opens a "popup" to show the correct image(internally, it downloads whole file). In 7.0.2, the issue is that this "popup" don't show the image. Shows the default icon again. You can see it in the screenshot send by @Do-D

Excuse my english level.

Regards Ch.

rodriguezchema avatar Sep 03 '14 08:09 rodriguezchema

Ah yes, sorry. I see it now: it looks like when you set "enable_previews" to false it somehow also affects the gallery app, which, from what I heard, uses the same preview system.

This is a bug. @icewind1991 @georgehrke any idea ?

PVince81 avatar Sep 03 '14 08:09 PVince81

I'm not sure about that, Gallery App seems work ok. The bug seems to be located in Files App (or ¿core module?).

I, particulary, don't use gallery app like a external module. I have enabled gallery to see images from File app.

Regards Ch.

rodriguezchema avatar Sep 03 '14 08:09 rodriguezchema

To clarify: when you click on an image file, a popup will appear with the image inside it (see https://github.com/owncloud/core/issues/10796#issue-41623128). That popup is implemented in the gallery app (aka "Pictures app").

This is why I'm saying it affects it. But thanks for clarification. So probably only that popup (slideshow.js) seem to be affected by the flag.

PVince81 avatar Sep 03 '14 08:09 PVince81

@rodriguezchema @PVince81
Yes i want to achieve the same behavior. NO Preview of Images,PDFs in the file list, but viewing pictures in a popup should be possible by clicking on it. I do not use the pictures app itself, but its enabled because otherwise the popup to view a picture is also disabled and download only is possible.

I think this means it has nothing to do with my nginx config. Would it be helpful to post my slideshow.js or something else?

Do-D avatar Sep 03 '14 14:09 Do-D

Hi,

I have Owncloud 7.0.2.1 via .deb Package (upgraded from 6.0.4). Due to performance reason I have set 'enable_previews' => false. I don't expect see the image in a list of files but I expect see the image when I click on the icon. It worked this way in 6.0.4.

After the upgrade noticing the issue described in initial post https://github.com/owncloud/core/issues/10796#issue-41623128

I suppose the reason of the issue is clear now (accordingly to PVince81 comments). Can you please restore old 'enable_previews' behaviour for "Files".

Thank you!

taurus-forever avatar Sep 08 '14 21:09 taurus-forever

@icewind1991 The issue here is that the slideshow started using the preview-system. So you should check if the preview system is disabled and if that's true just fallback to the raw image instead of the preview-system. Is this an duplicate of some issue in the gallery app?

georgehrke avatar Sep 08 '14 21:09 georgehrke

Guys, can you please share some workaround/code hack for the guys which using 'enable_previews' => false. It is fine for me to fallback to the raw image for the moment. Thank you!

taurus-forever avatar Oct 21 '14 13:10 taurus-forever

Fixed in master and stable7, the slideshow now falls back to showing the full image if loading the preview fails for some reason

icewind1991 avatar Oct 27 '14 15:10 icewind1991

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Aug 05 '19 20:08 lock[bot]