Forums / Setup & design / Another image problem

Another image problem

Author Message

Mark Overduin

Monday 25 August 2003 1:49:57 am

If I add an image to an article, it is not displayed when I view the article. It isn't even displayed in the admin console. Somehow, somewhere, something goes wrong...

But, when I display the full path to the image, using the following code, I get the original image with its original size. So, uploading works fine, but there might be a problem with the 'thumbnailing'.

- - - code - - -
{$node.data_map.thumbnail.content[original].full_path|ezroot}
- - - - - - - - -

What can it be? I have GD installed correctly. ImageMagick (what is this anyway?) is not installed. I thought I didn't have to install that, because I thought ezP3 uses GD OR ImageMagick.

[edit]
If I edit image.ini and tell ezP3 to use GD instead of 'convert', still nothing is displayed. Not even the images created with 'texttoimage()'. What to do now?
[/edit]

Thanx in advance.

-- Mark

Bjørn Kaarstein

Monday 25 August 2003 2:41:57 am

If you have altered your article class in EZP3.1, you might have this problem, because the admin-layout is handled by specific templates.

{$node.data_map.thumbnail.content[small].full_path|ezroot}
will display a thumbnail. You can set the images sizes for small, medium and large in site.ini

Regards Bjørn

Mark Overduin

Monday 25 August 2003 3:07:50 am

The article class is not modified.

{$node.data_map.thumbnail.content[original].full_path|ezroot}

shows

"var/storage/variations/image/p/h/p"

This is just a path without a filename. I checked and found out that the folder '...../h/p' is empty. I was expecting a thumbnail actually...

Bjørn Kaarstein

Monday 25 August 2003 3:21:30 am

OK, so it seems like your articles isn't stored at all, or do you have the list view in your admin interface? You might want to check that you have the necessary rights (r+w) to the right directories on your installation. Try to run a chmod -R 757 on the necessary directories.(Not very good for security, but OK for testing..)

Also, after publishing your article, manually go in to the directory of yours to check whether the image is there. It usually gets a weird filename.

Regards Bjørn

Mark Overduin

Monday 25 August 2003 3:33:10 am

All the directories of '/var' (including var itself) have 777 permissions.
When I create a new article and add an image to it, the image gets uploaded. Indeed, it has a weird filename (php0nZZRm.jpg).

Just enabled debug. There seems to be a problem with ezImageVariation:

- - - output - - -
Undefined attribute 'contentobject_attribute_id, version, requestedwith, requestedheight', cannot get
Debug: changing value of filename to default
Debug: changing value of width to default
- - - - - - - - - -

The line which contains 'cannot get' ends like that. It's not complete...

Thanks for all the help so far, but the problem is not solved.

I searched the forum for similar problems and there are lots of 'em, but so far I haven't found a thread with a solution (that fits my needs).

-- Mark

Bjørn Kaarstein

Monday 25 August 2003 4:06:52 am

If you go to the url - /content/view/full/66

(where 66 is the node_id of your article - found in the admin interface).

Try {$node|attribute(show)}, and you'll get a bunch of information, hopefully leading you closer to your goal.

If you're looping articles in a section, you can also write
{$:item|attribute(show)}

Also, if you alter you .ini files, rememeber that you'll have to clear the .ini cache.

Hope this helps.

Regards Bjørn

Mark Overduin

Wednesday 27 August 2003 4:27:22 am

Well, that didn't do the trick either...

I had to use images right away, so I programmed something. It's really simple. All the function does, is change the width/height of the image.
At first, I wanted to create real thumbnails (a new image: a copy of the original image, only smaller)

This is my code:
- - - code - - -
"/design/mydesign/override/template/line_article.tpl" (or just 'article.tpl'):
{$node.data_map.thumbnail.content[original].full_path|img_original}
or
{$node.data_map.thumbnail.content[original].full_path|img_thumbnail}

"/kernel/common/eztemplateautoload.php":
include ("marksPHPfunctions.inc.php");
$eZTemplateOperatorArray[] = array('class_parameter' => array('img_thumbnail' => 'img_thumbnail', 'img_original' => 'img_original'),
'operator_names' => array ('img_thumbnail', 'img_original'));

"/kernel/common/marksPHPfunctions.inc.php":
function resizeImage ($path2img, $newWidth, $newHeight)
{
$tmp = getimagesize ($path2img);
$width = $tmp[0];
$height = $tmp[1];
unset ($tmp);

if ($width >= $height)
{
if ($width > $newWidth)
{
$tmp = $width / $newWidth;
$width = $width / $tmp;
$height = $height / $tmp;
unset ($tmp);
}
}
if ($height > $newHeight)
{
$tmp = $height / $newHeight;
$height = $height / $tmp;
$width = $width / $tmp;
unset ($tmp);
}
$result = "<img src=\"/$path2img\" width=\"$width\" height=\"$height\" border=\"1\" align=\"right\">";
return ($result);
}

function img_thumbnail ($path2img)
{
$result = resizeImage ($path2img, 100, 75);
return ($result);
}

function img_original ($path2img)
{
$result = resizeImage ($path2img, 200, 150);
return ($result);
}

function getFilename ($path2img)
{
$filename = explode ("/", $path2img);
$filenameSize = sizeof ($filename);
$filename = $filename[$filenameSize-1];
return ($filename);
}
- - - - - - - - -

Maybe someone can use this also...

I know this is a lousy solution, but I had to use images, so... Plz don't mind the bad coding, I made in what, 40 minutes?
I'll get rid of it, as soon as the ezP3-way works.

-- Mark

eZ debug

Timing: Jan 31 2025 04:29:17
Script start
Timing: Jan 31 2025 04:29:17
Module start 'content'
Timing: Jan 31 2025 04:29:17
Module end 'content'
Timing: Jan 31 2025 04:29:17
Script end

Main resources:

Total runtime0.1302 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.9219180.8438
Module start 'content' 0.00550.0059 768.7656101.7422
Module end 'content' 0.01140.1187 870.5078531.0000
Script end 0.1301  1,401.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.6981200.0002
Check MTime0.00141.0626200.0001
Mysql Total
Database connection0.00060.449410.0006
Mysqli_queries0.086266.20201410.0006
Looping result0.00090.72711390.0000
Template Total0.118390.910.1183
Template load0.00090.665110.0009
Template processing0.117590.218410.1175
Override
Cache load0.00060.444810.0006
Sytem overhead
Fetch class attribute can translate value0.00060.483010.0006
XML
Image XML parsing0.00030.208010.0003
General
dbfile0.00826.2718200.0004
String conversion0.00000.004430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs