2

I have setup an asset pool for all files our customer wants to upload using {basePath} and {baseUrl} variables which are defined in the configuration file.

  • Uploading files works
  • Selecting files to assign them to content works
  • displaying the files on the front page works
  • thumbnail generation in the backend does not work - returning 404 for the resized url
  • custom transforms for thumbnails on the front page do not work - 0-byte images get created which are of course empty

Nothing gets logged in the errorlog - everything seems to work fine.

I'm kind of lost currently - Project working nicely local but not on our server. Any help on how to debug and solve this problem? Looks like an inconsistency problem inside of craft as some methods are accessing the assets correctly while others don't.


Here some files:

general.php

<?php return [
    'allowAutoUpdates'     => false, // Using shared craft, disable update triggering for customer - TODO: Completely hide update stuff in backend.
    'omitScriptNameInUrls' => true,
    'environmentVariables' => [
        'baseUrl' => CRAFT_SITE_URL,
        'basePath' => CRAFT_SITE_PATH
    ]
];

index.php

<?php

define('CRAFT_CONFIG_PATH',       'assets/configs/');
define('CRAFT_PLUGINS_PATH',      'assets/plugins/');
define('CRAFT_TEMPLATES_PATH',    'assets/templates/');
define('CRAFT_TRANSLATIONS_PATH', 'assets/translations/');
define('CRAFT_STORAGE_PATH',      'cache/');

define('CRAFT_SITE_URL',  substr($_SERVER['SCRIPT_NAME'], 0, -9));
define('CRAFT_SITE_PATH', substr(__FILE__, 0, -9));

require '../_craft/app/index.php';

.htaccess

# Compression
SetOutputFilter DEFLATE

RewriteEngine On

# No duplicate rewriting.
#TODO Remove and use [END] when Apache 2.4 is available on production.
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]

# Sass and JavaScript compilation and minification - except for admin backend.
RewriteCond %{REQUEST_URI} !admin/ [NC]
RewriteRule \.css$ scss.php [L]
RewriteCond %{REQUEST_URI} !admin/ [NC]
RewriteRule \.js$ js.php [L]

# Make bootstrap fonts available.
RewriteRule ^assets/bootstrap/(.+)$ vendor/twbs/bootstrap-sass/assets/fonts/bootstrap/$1 [L]

# Let craft handle everything else.
RewriteRule ^assets/icons/ - [L]
RewriteRule ^assets/images/ - [L]
RewriteRule .* index.php [L]

Both Environments have Imagick and GD available.

Environment Development: Ubuntu, Apache 2.4, PHP 5.6, MySQL 5.6

Environment Production: Debian, Apache 2.2, PHP 5.5, MySQL 5.5

1 Answer 1

3

It sounds like you're running into a bug in the latest version of Craft (2.4.2675) where transforms are broken for source asset files that end in an uppercase file extension (.JPG, .GIF, etc.).

It's already been fixed for the next release, but as a workaround you can rename the extensions to be lowercase and re-index your assets.

2
  • Yup, that fixed it, thanks. Any way, after updating to 2677 - which says the bug has been fixed, it was still not working. So i renamed them and now it works. Commented Jul 22, 2015 at 6:30
  • Yeah... we'll have another release out today that fixes the fix.
    – Brad Bell
    Commented Jul 22, 2015 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.