Database transaction failed when creating a new image object

Author Message

Nicolay Camargo

Wednesday 04 January 2006 6:46:16 pm

When I try to publish some image object, the common error message appears:

Fatal error: A database transaction in eZ publish failed..

It's a strange behavior because this kind of objects is often published successfully. Reviewing the postgreSQL database error log I found this related message:

ERROR: invalid byte sequence for encoding "UNICODE": 0xd00d

The full message is shown at the bottom. I wanted to find out more and I noted that in this case the problem is related with the EXIF data within each JPEG format image. When I edit the image with an advanced editor and choose "Don't save EXIF data" option, image is accepted in ezpublish without any error.

I'm not quite sure but it seems like a hidden character in this EXIF data created by the digital camera natively. I think that this character is incompatible with the UNICODE encoding in the database. am I right? must I report this as a bug? Although I have a way to solve this problem, it is difficult to any of my site users to publish an image like that, because they probably don't have an advanced image editor and anyway the work become tedious. So, can you help me to solve this problem? I'll thank you a lot.

This is the full message:

ERROR: invalid byte sequence for encoding "UNICODE": 0xd00d
LOCATION: pg_verifymbstr, wchar.c:862
SENTENCE: UPDATE ezcontentobject_attribute
SET contentclassattribute_id='118', attribute_original_id='0',
sort_key_int='0', sort_key_string='', data_type_string='ezimage',
data_text='<?xml version="1.0" encoding="UTF-8"?>
<ezimage serial_number="1"
is_valid="1"
filename="ensenando1.jpg"
suffix="jpg"
basename="ensenando1"
dirpath="var/castillo/storage/images-versioned/391/1-esl-ES"
url="var/castillo/storage/images-versioned/391/1-esl-ES/ensenando1.jpg"
original_filename="ensenando.jpg"
mime_type="image/jpeg"
width="640"
height="480"
alternative_text=""
alias_key="1293033771"
timestamp="1136396644">
<original attribute_id=""
attribute_version=""
attribute_language="" />
<information Height="480"
Width="640"
IsColor="1"
ByteOrderMotorola="0"
ApertureFNumber="f/2.8"
UserComment=""
Thumbnail.FileType="2"
Thumbnail.MimeType="image/jpeg">
<array name="ifd0">
<item key="ImageDescription">OLYMPUS DIGITAL CAMERA </item>
<item key="Make">OLYMPUS OPTICAL CO.,LTD</item>
<item key="Model">C150,D390</item>
<item key="Orientation">1</item>
<item key="XResolution">144/1</item>
<item key="YResolution">144/1</item>
<item key="ResolutionUnit">2</item>
<item key="Software">41-1002A</item>
<item key="DateTime">2003:11:30 10:03:10</item>
<item key="YCbCrPositioning">2</item>
<item key="Exif_IFD_Pointer">158</item>
<item key="UndefinedTag:0xC4A5">PrintIM0250
&#65533;&#65533; &apos;&apos;&apos;&apos;&apos;^&apos;&apos;&#65533;apos;&#65533;apos;</item>
</array>
<array name="exif">
<item key="ExposureTime">216/10000</item>
<item key="FNumber">28/10</item>
<item key="ExposureProgram">2</item>
<item key="ISOSpeedRatings">100</item>
<item key="ExifVersion">0220</item>
<item key="DateTimeOriginal">2003:11:30 10:03:10</item>
<item key="DateTimeDigitized">2003:11:30 10:03:10</item>
<item key="ComponentsConfiguration"></item>
<item key="CompressedBitsPerPixel">23/10</item>
<item key="ExposureBiasValue">0/10</item>
<item key="MaxApertureValue">300/100</item>
<item key="MeteringMode">2</item>
<item key="LightSource">0</item>
<item key="Flash">24</item>
<item key="FocalLength">500/100</item>
<item key="MakerNote">OLYMPv&#130;&#65533; &#65533;#
)8:</item>
<item key="UserComment"> </item>
<item key="FlashPixVersion">0100</item>
<item key="ColorSpace">1</item>
<item key="ExifImageWidth">1600</item>
<item key="ExifImageLength">1200</item>
<item key="InteroperabilityOffset">1096</item>
<item key="FileSource"></item>
<item key="CustomRendered">0</item>
<item key="ExposureMode">1</item>
<item key="WhiteBalance">0</item>
<item key="DigitalZoomRatio">160/100</item>
<item key="SceneCaptureType">0</item>
<item key="GainControl">1</item>
<item key="Contrast">0</item>
<item key="Saturation">0</item>
<item key="Sharpness">0</item>
</array>
</information>
</ezimage>', data_int=NULL, data_float='0.000000'
WHERE id='391' AND contentobject_id='119' AND version='1' AND language_code='esl-ES'

Thanks,

Nicolay
Corenet S.A.
Bogota - Colombia
www.corenet.net.co
acamargo@corenet.net.co

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 18 2025 22:39:03
Script start
Timing: Jan 18 2025 22:39:03
Module start 'layout'
Timing: Jan 18 2025 22:39:03
Module start 'content'
Timing: Jan 18 2025 22:39:05
Module end 'content'
Timing: Jan 18 2025 22:39:05
Script end

Main resources:

Total runtime1.4681 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 589.2891152.6563
Module start 'layout' 0.00840.0055 741.945339.5078
Module start 'content' 0.01401.4527 781.4531496.7031
Module end 'content' 1.46670.0014 1,278.156312.0938
Script end 1.4681  1,290.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2379160.0002
Check MTime0.00140.0928160.0001
Mysql Total
Database connection0.00220.153110.0022
Mysqli_queries1.383494.2306460.0301
Looping result0.00050.0355440.0000
Template Total1.429497.420.7147
Template load0.00210.141020.0010
Template processing1.427397.217820.7136
Template load and register function0.00010.008910.0001
states
state_id_array0.00070.046910.0007
state_identifier_array0.00130.091720.0007
Override
Cache load0.00180.1255950.0000
Sytem overhead
Fetch class attribute can translate value0.00170.116210.0017
Fetch class attribute name0.00090.060320.0004
XML
Image XML parsing0.00090.059110.0009
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00140.0976160.0001
String conversion0.00000.000840.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs