owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.39k stars 2.05k forks source link

Changed logo.{png,svg} does not show up in Chrome #2483

Closed tedwardd closed 11 years ago

tedwardd commented 11 years ago

I had an install of 4.5 that had a custom logo.png and logo.svg and they worked fine in Chrome and Firefox. I have created a new install of 5.0.0 and re-used the same logo.svg and logo.png files and they now only show up in Firefox. File information below:

ls -lZa /var/www/owncloud/core/img/logo.*

-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/owncloud/core/img/logo.png
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/owncloud/core/img/logo.svg

I reused the same logo-wide.{svg,png} and they work in both browsers without issue.

BernhardPosselt commented 11 years ago

Please restore the selinux context.

BernhardPosselt commented 11 years ago

I very much think that this is a selinux bug, so can you try if it works without selinux enabled? (you need to reboot)

If this its still a bug, please reopen.

tedwardd commented 11 years ago

I fail to see how blaming this on SELinux makes any sense since the issue is browser dependant. If apache was being prevented from accessing the image by SELinux would the behavior not be consistent regardless of browser used on the client end? On Mar 21, 2013 5:41 AM, "Bernhard Posselt" notifications@github.com wrote:

I very much think that this is a selinux bug, so can you try if it works without selinux enabled? (you need to reboot)

If this its still a bug, please reopen.

— Reply to this email directly or view it on GitHubhttps://github.com/owncloud/core/issues/2483#issuecomment-15227179 .

BernhardPosselt commented 11 years ago

I see my bad, can you provide information and logs like in the contribution guidelines?

tedwardd commented 11 years ago

My apologies, I did not know such a thing existed. I will report issues in this way in the future. Thank you for reconsidering based on my concerns.

Expected behaviour

Large custom logo should appear at the top of the log in screen when logo.svg and logo.png are replaced by different files.

Actual behaviour

Firefox displays the file without issue, however, Chrome does not. The logo-wide at the top left of the screen after log in appears without issue in both browsers.

Steps to reproduce

The image file that is being used has the following dimensions and file size.

Server configuration

Operating system: Red Hat Enterprise Linux Server release 6.3 (Santiago)

Web server: httpd-2.2.15-26.el6.x86_64

Database: mysql-server-5.1.67-1.el6_3.x86_64

PHP version: php-5.3.3-22.el6.x86_64

ownCloud version: 5.0.0

Client configuration

Browser: Firefox 19 (tested 10ESR, 17ESR and 19), Chrome 23 (tested 23 - 25)

Operating system: Ubuntu 12.04, Fedora 17, Windows 7, Mac OSX 10.8.3

Logs

Web server error log

Too long to include, the entire log is about 12GB... (wow, I didn't remember until just now I had apache in debug mode)

ownCloud log (data/owncloud.log)

This is only a snippet of the actual log, the entire file is about 600MB... mostly all this error, over several hundred entries per "time" entry

{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}
{"app":"PHP","message":"Undefined variable: collectionTypes at \/var\/www\/owncloud\/lib\/public\/share.php#918","level":2,"time":1363874724}

Browser log

Chrome Java console upon loading log in page:

GET https://filexxxx.xxxxx.xxxx.xxxxxx.edu/cron.php 500 (Internal Server Error) core.js:84
send core.js:84
f.extend.ajax core.js:81
f.(anonymous function) core.js:77
(anonymous function) core.js:428
o core.js:15
p.fireWith core.js:16
e.extend.ready core.js:10
c.addEventListener.B

Network log from Chrome no_logo_chrome_OC5

Elements from Chrome showing that it is loading the svg file but it is hidden, possibly underneath the blue background? Screenshot from 2013-03-21 10:34:46

jancborchardt commented 11 years ago

@k4k from the small thumbnail from the inspector in the second screenshot it looks like the SVG image is broken. Does it work if you just directly link the PNG in the layout.guest.php template (in core/templates)?

tedwardd commented 11 years ago

@jancborchardt, for what it's worth, if I navigate to the URL the image resides at, I do see the image in the browser. I am also able to download that file and view it in a local image viewer. I will try replacing the image with a different, random, svg image and see if the behavior changes. I'll admit that it's not outside the realm of possibility that the image is corrupt, but I am not yet convinced that that is the case or I would assume neither Chrome or Firefox would display the image and I would not be able to view the image in these browsers by itself.

MelonSmasher commented 11 years ago

I am also having this problem, Debian 6 OC 5. I had no issues with oc 4.7.*

Screenshot

Works in FF and IE, they all try display the SVG not the PNG. How can i force the PNG?

If i right click on the image and select inspect element and change the extension to png it loads.

MelonSmasher commented 11 years ago

I changed the file extentions in layout.user.php to fix the logo in the top left corner when logged in.

Line37 print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="png"

Line38 print_unescaped(image_path('', 'logo-wide.png')); ?>" alt="ownCloud"

and the same thing for the main logo in layout.guest.php

jancborchardt commented 11 years ago

@almyz125, yeah, as I said before »just directly link the PNG in the core/templates/layout.guest.php« and layout.user.php files. Then maybe also remove the class="svg" but not sure if that’s necessary.

In general, please try to use SVG with PNG fallback because otherwise your logo will look very bad on a higher resolution display such as the retina ones.

tedwardd commented 11 years ago

@jancborchardt why is this closed?

::EDIT:: Oh, let me try your fix... sorry I got the close notification but missed your suggestion a few posts back.. I'll request re-opening if that does not work.

jancborchardt commented 11 years ago

@k4k (saw your edit), yep, just let me know if it doesn’t work. But please note that I don’t necessarily have time for extensive support as this is a non-core customization issue. If you want proper theming and whitelabeling support, please get in contact with ownCloud Inc. :)

MelonSmasher commented 11 years ago

@jancborchardt i tried the png extension with class="svg" in place and it worked, though i replaced it with class="png " on the ccs file that i am going to use.

jancborchardt commented 11 years ago

@almyz125 class="svg" is just used by our Javascript to provide a PNG fallback for browsers which don’t handle SVG. Changing it to class="png" is not needed since the class png is not known by ownCloud and thus never called.

tedwardd commented 11 years ago

@jancborchardt statically linking to the PNG and removing class="svg" successfully bypasses this issue. Thanks for the suggestion. Here's hoping it was just my SVG and not something that will come up for others.

jancborchardt commented 11 years ago

@k4k cool!