What do these errors mean?

Author Message

Dominik Pich

Monday 29 March 2004 5:58:41 am

I imported images using this

	/**
	 * Instantiates the eZImage class and assignes it to the attribute passed.
	 * Not written by me, downloaded from ez.no!
	 * @param fileName File's name.
	 * @param contentObjectAttribute The attribute to modify.
	 */
	function saveImage( $fileName, &$contentObjectAttribute )
	{
		//get info from contentObjectAttribute
		$contentObjectAttributeID = $contentObjectAttribute->attribute( "id" );
		$version = $contentObjectAttribute->attribute( "version" );
	
		//create the new ezImage
		$image =& eZImage::create( $contentObjectAttributeID , $version );
		
		$image->setAttribute( "contentobject_attribute_id", $contentObjectAttributeID );
		$image->setAttribute( "version", $version );
		$image->setAttribute( "filename", $fileName );
		$image->setAttribute( "original_filename", $fileName );
		
		//set alterative texts
		$mimeObj = new eZMimeType();
		$mime = $mimeObj->mimeTypeFor( false, $fileName );
		$image->setAttribute( "mime_type", $mime );
		$image->setAttribute( "alternative_text", $fileName );
		$image->store();
	
		//make dir to copy to
		$ori_dir = $this->DIRECTORY_STORAGE . '/' . "original/image/";
		$ref_dir = $storage_dir . '/' . "reference/image/";
		if ( !file_exists( $ori_dir ) )
		{
			eZDir::mkdir( $ori_dir, 0777, true);
		}
		if ( !file_exists( $ref_dir ) )
		{
			eZDir::mkdir( $ref_dir, 0777, true);
		}
	
		//copy to storage
		$source_file = $this->DIRECTORY_INCOMING . $fileName;
		$target_file = $ori_dir . $fileName;
		$reference_file = $storage_dir . "/reference/image/" . $fileName;
		eZDebug::writeDebug( 'copy from ' . $source_file . ' to ' . $target_file );
		copy($source_file, $target_file );
	}

Allworks but I keep getting errors:

Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
The reference alias original file var/notencity/storage/images/alle/364-1-ger-DE/alle. does not exist 
Error:  Mar 29 2004 16:11:37 
Original alias does not exists, cannot create other aliases without it 
Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
Failed creating the referenced alias reference, cannot create alias large 
Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
The reference alias original file var/notencity/storage/images/instrument/367-2-ger-DE/instrument. does not exist 
Error:  Mar 29 2004 16:11:37 
Original alias does not exists, cannot create other aliases without it 
Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
Failed creating the referenced alias reference, cannot create alias large 
Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
The reference alias original file var/notencity/storage/images/genre/370-1-ger-DE/genre. does not exist 
Error:  Mar 29 2004 16:11:37 
Original alias does not exists, cannot create other aliases without it 
Error: eZImageManager::createImageAlias Mar 29 2004 16:11:37 
Failed creating the referenced alias reference, cannot create alias large 

Dominik Pich

Tuesday 30 March 2004 12:21:57 am

How to propertly import images?
I found the above code here.

Alex Jones

Tuesday 30 March 2004 5:59:09 am

Which version of eZ publish are you using?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Dominik Pich

Wednesday 31 March 2004 12:52:06 am

Seite:
osiris/notencity/index.php

Version
3.3-2 (3.3)

SVN Revision
4764

Erweiterungen
sheet

PHP
4.3.3

Alex Jones

Wednesday 31 March 2004 6:15:09 am

The image system was changed with the release of 3.3. According to the New Image System article (http://ez.no/ez_publish/download/changelogs/ez_publish_3_3/new_image_system), the way to import images is different. Instead of the large block of code required previously, you can now import with:

<b>PHP interface</b>
The interface to the image datatype and image system has been modified, this means that import script or other PHP code that used the old eZImage and eZImageVariation directly will need to change the code.
While this sounds bad it is actually quite easier to work with the new image system, instead of copying the images and creating references yourself you may now simply pass the image file path to a function in eZImageAliasHandler.

Example:

$content =& $attribute->content();
// $content is now an instance of eZImageAliasHandler
if ( is_object( $content ) )
{
    $content->initializeFromFile( $imageFile );
    if ( $content->isStorageRequired() )
    {
        $content->store();
    }
}

I ran into some problems with my import, and with the help of Wenyue, got it working again. I would highly recommend you upgrade to 3.3-4 and try using the above code. If, you cannot upgrade, or if you upgrade and it still doesn't work, post here and I can post the changes we made to the <i>ezimagealiashandler</i> kernal code. But hopefully, they solved those issues in 3.3-4.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Dominik Pich

Monday 05 April 2004 5:35:06 am

After upgrading as you proposed, no errors are outputted anymore even though I did not change the code...
Thanks :)

Alex Jones

Monday 05 April 2004 6:44:51 am

Glad to hear it. :)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 08:50:32
Script start
Timing: Jan 19 2025 08:50:32
Module start 'layout'
Timing: Jan 19 2025 08:50:32
Module start 'content'
Timing: Jan 19 2025 08:50:33
Module end 'content'
Timing: Jan 19 2025 08:50:33
Script end

Main resources:

Total runtime0.9108 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.1563152.6250
Module start 'layout' 0.00710.0044 741.781339.4453
Module start 'content' 0.01150.8977 781.2266589.6875
Module end 'content' 0.90920.0015 1,370.914120.1641
Script end 0.9107  1,391.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4004160.0002
Check MTime0.00150.1616160.0001
Mysql Total
Database connection0.00090.100010.0009
Mysqli_queries0.848293.1277690.0123
Looping result0.00070.0735670.0000
Template Total0.871495.720.4357
Template load0.00200.224520.0010
Template processing0.869495.455020.4347
Template load and register function0.00010.014510.0001
states
state_id_array0.00120.136710.0012
state_identifier_array0.00270.301320.0014
Override
Cache load0.00170.1866450.0000
Sytem overhead
Fetch class attribute can translate value0.00060.063020.0003
Fetch class attribute name0.00090.098880.0001
XML
Image XML parsing0.00060.061220.0003
class_abstraction
Instantiating content class attribute0.00000.0023100.0000
General
dbfile0.00130.1475160.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs