Forum

Thread tagged as: Question

Images not previewing in Asset Library

I recently uploaded a Perch website to a Linux turnkey server. The thumbnail previews within the assets library loads fine when working offline on a localhost. However when on the server images don't preview. The client's IT I'm dealing with are suggesting that the server has image processing installed. Ant idea why this is happening?

Summary information

Perch: 3.0.8, PHP: 5.6.30-0+deb8u1, MySQL: 5.5.55, with PDO
Server OS: Linux, apache2handler
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.5.1), perch_members (1.6.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/perch
PERCH_CORE: /var/www/perch/core
PERCH_RESFILEPATH: /var/www/perch/resources
Image manipulation: Imagick
PHP limits: Max upload 16M, Max POST 16M, Memory: 128M, Total max file upload: 16M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: 217.112.148.242
DOCUMENT_ROOT: /var/www/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Cormac Kerrigan

Cormac Kerrigan 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you upload an image does the thumbnail file get added to the file system?

Hi Drew. The image preview appears to working only on certain pages. We have a selection of blocks for the client to use. On one page the previews of one block will display no problem, where as the exact same block template used on another page will not display!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you checked you error log? Does the same content work in both places?

Hi Drew, I've checked error logs and nothing is jumping out to me on either a block region page where images previews are failing:

Debug Message - Perch 3.0.8
[1]
SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='4d0f99128c43922ed663879de0e1c30b' LIMIT 1
UPDATE perch3_users SET userHash='0ee3d8dafd84377549abada44e33ea84' WHERE userID='1'
[37]
SELECT p.privKey FROM perch3_user_privileges p
[29]
SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[8]
SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1]
SELECT * FROM perch3_content_regions WHERE regionID=192 LIMIT 1
[1]
SELECT * FROM perch3_pages WHERE pageID='47' LIMIT 1
Using template: /templates/content/blocks.html
[1]
SELECT * FROM perch3_content_items c WHERE c.regionID=192 AND c.itemRev=83 ORDER BY c.itemOrder ASC
Using template: /templates/content/blocks.html
[1]
SELECT * FROM perch3_content_items c WHERE c.regionID=192 AND c.itemRev=83 ORDER BY c.itemOrder ASC
Using template: /templates/content/blocks.html
Form not posted or did not validate
[1]
SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[3]
SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1]
SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1]
SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2]
SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/edit.form.post.php
[1]
SELECT * FROM perch3_resources WHERE resourceID='111' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='78' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='93' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='94' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='95' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='77' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='103' LIMIT 1
[1]
SELECT * FROM perch3_resources WHERE resourceID='68' LIMIT 1

or directly within the Asset Preview library:

Debug Message - Perch 3.0.8
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='24c709d3d295ee6664982c460cf9d4e7' LIMIT 1
UPDATE perch3_users SET userHash='2c8db828e1bd12e57152538ea65007b0' WHERE userID='1'
[37] SELECT p.privKey FROM perch3_user_privileges p
[29] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[8] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[30] SELECT SQL_CALC_FOUND_ROWS DISTINCT r1.*, r2.resourceFile AS thumb, r2.resourceWidth AS thumbWidth, r2.resourceHeight AS thumbHeight, r2.resourceDensity AS thumbDensity FROM perch3_resources r1 LEFT OUTER JOIN perch3_resources r2 ON r2.resourceParentID=r1.resourceID AND r2.resourceKey='thumb' AND r2.resourceAWOL!=1 WHERE r1.resourceKey='orig' AND r1.resourceAWOL=0 ORDER BY r1.resourceUpdated DESC, r1.resourceID DESC LIMIT 0, 30
[141] SELECT FOUND_ROWS() AS `count`
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[3] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='assets' LIMIT 1
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/assets/modes/list.post.php
[4] SELECT DISTINCT resourceType FROM perch3_resources WHERE resourceAWOL=0 AND resourceType !="" ORDER BY resourceType ASC
[1] SELECT DISTINCT resourceBucket FROM perch3_resources WHERE resourceAWOL=0 AND resourceType !=""
[nil] SELECT t.tagTitle, t.tagSlug, t.tagCount FROM perch3_resource_tags t WHERE tagCount > 0 GROUP BY t.tagID ORDER BY t.tagCount DESC LIMIT 40
Queries: 16
Memory: 1.0564

"Does the same content work in both places?" I'm not sure exactly what you mean by this? All content works, it's just image previews on Perch are sporadically working within certain blocks and pages. And on the Asset Library window, image previews do not work at all. I believe this is a server issue of some sort as everything works fine for me on my virtual server. Can this be identified though by Perch?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It sounds like something you should ask your host about.

Hi Drew, In relation to the above. The hosting/IT have confirmed they have libmagickwand 6 installed on their server and are querying would libmagickwand dev work instead? Does Perch have any known limitations to it's image processing capabilities on servers?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Perch doesn't process the images itself - that's done by the libraries on the server. So the limitations are in memory availability, file upload allowances (a PHP setting), disk space etc.