Forums / General / Database transaction failed when creating a new image object

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

eZ debug

Timing: Jan 18 2025 19:12:54
Script start
Timing: Jan 18 2025 19:12:54
Module start 'content'
Timing: Jan 18 2025 19:12:54
Module end 'content'
Timing: Jan 18 2025 19:12:55
Script end

Main resources:

Total runtime0.1539 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.0074 589.0938180.8047
Module start 'content' 0.00740.0073 769.898497.9453
Module end 'content' 0.01470.1392 867.8438537.4219
Script end 0.1539  1,405.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00402.5788200.0002
Check MTime0.00150.9550200.0001
Mysql Total
Database connection0.00080.489710.0008
Mysqli_queries0.103867.43881410.0007
Looping result0.00130.86021390.0000
Template Total0.138890.110.1388
Template load0.00100.617810.0010
Template processing0.137889.518210.1378
Override
Cache load0.00070.429510.0007
Sytem overhead
Fetch class attribute can translate value0.00090.567210.0009
XML
Image XML parsing0.00030.173510.0003
General
dbfile0.00553.5451200.0003
String conversion0.00000.005330.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