Merge lp:~zorba-coders/zorba/bug-1158052-image into lp:zorba/image-module

Proposed by Paul J. Lucas
Status: Merged
Merged at revision: 57
Proposed branch: lp:~zorba-coders/zorba/bug-1158052-image
Merge into: lp:zorba/image-module
Diff against target: 381 lines (+41/-42)
4 files modified
src/com/zorba-xquery/www/modules/image/animation.xq.src/animation.cpp (+2/-2)
src/com/zorba-xquery/www/modules/image/basic.xq.src/basic.cpp (+5/-6)
src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation.cpp (+33/-33)
src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1158052-image
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Paul J. Lucas Approve
Review via email: mp+170946@code.launchpad.net

Commit message

Corresponding changes for bug #1158052.

Description of the change

Corresponding changes for bug #1158052.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/com/zorba-xquery/www/modules/image/animation.xq.src/animation.cpp'
--- src/com/zorba-xquery/www/modules/image/animation.xq.src/animation.cpp 2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/www/modules/image/animation.xq.src/animation.cpp 2013-06-22 13:12:26 +0000
@@ -56,7 +56,7 @@
56 Magick::writeImages(lImageList.begin(), lImageList.end(), &lBlob, true);56 Magick::writeImages(lImageList.begin(), lImageList.end(), &lBlob, true);
57 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob); 57 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob);
58 58
59 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());59 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
60 ImageFunction::checkIfItemIsNull(lItem);60 ImageFunction::checkIfItemIsNull(lItem);
61 return ItemSequence_t(new SingletonItemSequence(lItem));61 return ItemSequence_t(new SingletonItemSequence(lItem));
62}62}
@@ -90,7 +90,7 @@
90 Magick::writeImages(lImageList.begin(), lImageList.end(), &lBlob, true);90 Magick::writeImages(lImageList.begin(), lImageList.end(), &lBlob, true);
91 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob);91 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob);
9292
93 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());93 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
94 ImageFunction::checkIfItemIsNull(lItem);94 ImageFunction::checkIfItemIsNull(lItem);
95 return ItemSequence_t(new SingletonItemSequence(lItem));95 return ItemSequence_t(new SingletonItemSequence(lItem));
96}96}
9797
=== modified file 'src/com/zorba-xquery/www/modules/image/basic.xq.src/basic.cpp'
--- src/com/zorba-xquery/www/modules/image/basic.xq.src/basic.cpp 2013-06-12 05:12:20 +0000
+++ src/com/zorba-xquery/www/modules/image/basic.xq.src/basic.cpp 2013-06-22 13:12:26 +0000
@@ -119,7 +119,7 @@
119 String lType = ImageFunction::getOneStringArg(aArgs, 1);119 String lType = ImageFunction::getOneStringArg(aArgs, 1);
120 lImage.magick(lType.c_str()); 120 lImage.magick(lType.c_str());
121 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);121 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
122 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());122 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true));
123123
124 ImageFunction::checkIfItemIsNull(lItem);124 ImageFunction::checkIfItemIsNull(lItem);
125 return ItemSequence_t(new SingletonItemSequence(lItem));125 return ItemSequence_t(new SingletonItemSequence(lItem));
@@ -150,7 +150,7 @@
150150
151 lImage.magick(lType.c_str()); // Set output format 151 lImage.magick(lType.c_str()); // Set output format
152 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage); 152 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
153 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());153 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
154154
155 ImageFunction::checkIfItemIsNull(lItem);155 ImageFunction::checkIfItemIsNull(lItem);
156 return ItemSequence_t(new SingletonItemSequence(lItem));156 return ItemSequence_t(new SingletonItemSequence(lItem));
@@ -182,7 +182,7 @@
182 }182 }
183 lImage.quality(lQuality); // Set output format 183 lImage.quality(lQuality); // Set output format
184 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);184 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
185 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());185 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true));
186 ImageFunction::checkIfItemIsNull(lItem);186 ImageFunction::checkIfItemIsNull(lItem);
187 return ItemSequence_t(new SingletonItemSequence(lItem));187 return ItemSequence_t(new SingletonItemSequence(lItem));
188188
@@ -209,7 +209,7 @@
209 lBlankImage.magick(lType.c_str()); // Set output format 209 lBlankImage.magick(lType.c_str()); // Set output format
210210
211 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lBlankImage); 211 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lBlankImage);
212 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());212 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true));
213 ImageFunction::checkIfItemIsNull(lItem);213 ImageFunction::checkIfItemIsNull(lItem);
214 return ItemSequence_t(new SingletonItemSequence(lItem));214 return ItemSequence_t(new SingletonItemSequence(lItem));
215 215
@@ -285,5 +285,4 @@
285 return new zorba::imagemodule::basicmodule::BasicModule();285 return new zorba::imagemodule::basicmodule::BasicModule();
286}286}
287287
288288/* vim:set et sw=2 ts=2: */
289
290289
=== modified file 'src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation.cpp'
--- src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation.cpp 2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation.cpp 2013-06-22 13:12:26 +0000
@@ -42,7 +42,7 @@
42 const unsigned int lNewHeight = ImageFunction::getOneUnsignedIntArg(aArgs, 2);42 const unsigned int lNewHeight = ImageFunction::getOneUnsignedIntArg(aArgs, 2);
43 lImage.size(Magick::Geometry(lNewWidth, lNewHeight));43 lImage.size(Magick::Geometry(lNewWidth, lNewHeight));
44 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);44 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
45 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());45 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
46 ImageFunction::checkIfItemIsNull(lItem);46 ImageFunction::checkIfItemIsNull(lItem);
47 return ItemSequence_t(new SingletonItemSequence(lItem));47 return ItemSequence_t(new SingletonItemSequence(lItem));
48}48}
@@ -67,7 +67,7 @@
67 const unsigned int lRatio = lNewWidth/lImage.columns();67 const unsigned int lRatio = lNewWidth/lImage.columns();
68 lImage.zoom(Magick::Geometry(lNewWidth, lImage.rows()*lRatio));68 lImage.zoom(Magick::Geometry(lNewWidth, lImage.rows()*lRatio));
69 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);69 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
70 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());70 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true));
71 ImageFunction::checkIfItemIsNull(lItem);71 ImageFunction::checkIfItemIsNull(lItem);
72 return ItemSequence_t(new SingletonItemSequence(lItem));72 return ItemSequence_t(new SingletonItemSequence(lItem));
7373
@@ -94,7 +94,7 @@
94 const unsigned int lRatio = lNewHeight / lImage.rows();94 const unsigned int lRatio = lNewHeight / lImage.rows();
95 lImage.zoom(Magick::Geometry(lImage.columns()*lRatio, lNewHeight));95 lImage.zoom(Magick::Geometry(lImage.columns()*lRatio, lNewHeight));
96 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);96 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
97 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());97 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
98 ImageFunction::checkIfItemIsNull(lItem);98 ImageFunction::checkIfItemIsNull(lItem);
99 return ItemSequence_t(new SingletonItemSequence(lItem));99 return ItemSequence_t(new SingletonItemSequence(lItem));
100100
@@ -120,7 +120,7 @@
120 const double lRatio = ImageFunction::getOneDoubleArg(aArgs, 1);120 const double lRatio = ImageFunction::getOneDoubleArg(aArgs, 1);
121 lImage.zoom(Magick::Geometry(lImage.columns()*lRatio, lImage.rows()*lRatio));121 lImage.zoom(Magick::Geometry(lImage.columns()*lRatio, lImage.rows()*lRatio));
122 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);122 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
123 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());123 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
124 ImageFunction::checkIfItemIsNull(lItem);124 ImageFunction::checkIfItemIsNull(lItem);
125 return ItemSequence_t(new SingletonItemSequence(lItem));125 return ItemSequence_t(new SingletonItemSequence(lItem));
126}126}
@@ -149,7 +149,7 @@
149 // crop away everything that is either right of lRightLowerX or below lRightLowerY149 // crop away everything that is either right of lRightLowerX or below lRightLowerY
150 lImage.crop(Magick::Geometry(lWidth, lHeight));150 lImage.crop(Magick::Geometry(lWidth, lHeight));
151 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);151 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
152 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());152 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
153 ImageFunction::checkIfItemIsNull(lItem);153 ImageFunction::checkIfItemIsNull(lItem);
154 return ItemSequence_t(new SingletonItemSequence(lItem));154 return ItemSequence_t(new SingletonItemSequence(lItem));
155}155}
@@ -201,7 +201,7 @@
201 lImage.composite(lOverlayImage, lLeftUpperX, lLeftUpperY, Magick::BumpmapCompositeOp);201 lImage.composite(lOverlayImage, lLeftUpperX, lLeftUpperY, Magick::BumpmapCompositeOp);
202 } 202 }
203 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);203 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
204 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());204 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
205 ImageFunction::checkIfItemIsNull(lItem);205 ImageFunction::checkIfItemIsNull(lItem);
206 return ItemSequence_t(new SingletonItemSequence(lItem));206 return ItemSequence_t(new SingletonItemSequence(lItem));
207}207}
@@ -227,7 +227,7 @@
227 // chop away everything that is either left of lLeftUpperX or above lLeftUpperY227 // chop away everything that is either left of lLeftUpperX or above lLeftUpperY
228 lImage.chop(Magick::Geometry(lLeftUpperX, lLeftUpperY));228 lImage.chop(Magick::Geometry(lLeftUpperX, lLeftUpperY));
229 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);229 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
230 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());230 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
231 ImageFunction::checkIfItemIsNull(lItem);231 ImageFunction::checkIfItemIsNull(lItem);
232 return ItemSequence_t(new SingletonItemSequence(lItem));232 return ItemSequence_t(new SingletonItemSequence(lItem));
233}233}
@@ -252,7 +252,7 @@
252 // crop away everything that is either right of lRightLowerX or below lRightLowerY252 // crop away everything that is either right of lRightLowerX or below lRightLowerY
253 lImage.crop(Magick::Geometry(lRightLowerX, lRightLowerY));253 lImage.crop(Magick::Geometry(lRightLowerX, lRightLowerY));
254 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);254 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
255 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());255 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
256 ImageFunction::checkIfItemIsNull(lItem);256 ImageFunction::checkIfItemIsNull(lItem);
257 return ItemSequence_t(new SingletonItemSequence(lItem));257 return ItemSequence_t(new SingletonItemSequence(lItem));
258}258}
@@ -274,7 +274,7 @@
274 int lAngle = ImageFunction::getOneIntArg(aArgs, 1);274 int lAngle = ImageFunction::getOneIntArg(aArgs, 1);
275 lImage.rotate(lAngle%360);275 lImage.rotate(lAngle%360);
276 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);276 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
277 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());277 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
278 ImageFunction::checkIfItemIsNull(lItem);278 ImageFunction::checkIfItemIsNull(lItem);
279 return ItemSequence_t(new SingletonItemSequence(lItem));279 return ItemSequence_t(new SingletonItemSequence(lItem));
280}280}
@@ -296,7 +296,7 @@
296 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);296 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
297 lImage.erase();297 lImage.erase();
298 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);298 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
299 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());299 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
300 ImageFunction::checkIfItemIsNull(lItem);300 ImageFunction::checkIfItemIsNull(lItem);
301 return ItemSequence_t(new SingletonItemSequence(lItem));301 return ItemSequence_t(new SingletonItemSequence(lItem));
302}302}
@@ -318,7 +318,7 @@
318 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);318 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
319 lImage.flop();319 lImage.flop();
320 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);320 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
321 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());321 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
322 ImageFunction::checkIfItemIsNull(lItem);322 ImageFunction::checkIfItemIsNull(lItem);
323 return ItemSequence_t(new SingletonItemSequence(lItem));323 return ItemSequence_t(new SingletonItemSequence(lItem));
324}324}
@@ -339,7 +339,7 @@
339 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);339 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
340 lImage.flip();340 lImage.flip();
341 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);341 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
342 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());342 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
343 ImageFunction::checkIfItemIsNull(lItem);343 ImageFunction::checkIfItemIsNull(lItem);
344 return ItemSequence_t(new SingletonItemSequence(lItem));344 return ItemSequence_t(new SingletonItemSequence(lItem));
345}345}
@@ -360,7 +360,7 @@
360 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);360 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
361 lImage.trim();361 lImage.trim();
362 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);362 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
363 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());363 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
364 ImageFunction::checkIfItemIsNull(lItem);364 ImageFunction::checkIfItemIsNull(lItem);
365 return ItemSequence_t(new SingletonItemSequence(lItem));365 return ItemSequence_t(new SingletonItemSequence(lItem));
366}366}
@@ -401,7 +401,7 @@
401 } 401 }
402402
403 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);403 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
404 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());404 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
405 ImageFunction::checkIfItemIsNull(lItem);405 ImageFunction::checkIfItemIsNull(lItem);
406 return ItemSequence_t(new SingletonItemSequence(lItem));406 return ItemSequence_t(new SingletonItemSequence(lItem));
407}407}
@@ -426,7 +426,7 @@
426 int lSigma = ImageFunction::getOneIntArg(aArgs, 2);426 int lSigma = ImageFunction::getOneIntArg(aArgs, 2);
427 lImage.blur(lRadius, lSigma);427 lImage.blur(lRadius, lSigma);
428 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);428 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
429 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());429 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
430430
431 ImageFunction::checkIfItemIsNull(lItem);431 ImageFunction::checkIfItemIsNull(lItem);
432 return ItemSequence_t(new SingletonItemSequence(lItem));432 return ItemSequence_t(new SingletonItemSequence(lItem));
@@ -450,7 +450,7 @@
450 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);450 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
451 lImage.despeckle();451 lImage.despeckle();
452 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);452 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
453 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());453 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
454 ImageFunction::checkIfItemIsNull(lItem);454 ImageFunction::checkIfItemIsNull(lItem);
455 return ItemSequence_t(new SingletonItemSequence(lItem));455 return ItemSequence_t(new SingletonItemSequence(lItem));
456}456}
@@ -471,7 +471,7 @@
471 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);471 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
472 lImage.enhance();472 lImage.enhance();
473 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);473 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
474 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());474 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
475 ImageFunction::checkIfItemIsNull(lItem);475 ImageFunction::checkIfItemIsNull(lItem);
476 return ItemSequence_t(new SingletonItemSequence(lItem));476 return ItemSequence_t(new SingletonItemSequence(lItem));
477}477}
@@ -493,7 +493,7 @@
493 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);493 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
494 lImage.equalize();494 lImage.equalize();
495 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);495 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
496 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());496 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
497 ImageFunction::checkIfItemIsNull(lItem);497 ImageFunction::checkIfItemIsNull(lItem);
498 return ItemSequence_t(new SingletonItemSequence(lItem));498 return ItemSequence_t(new SingletonItemSequence(lItem));
499}499}
@@ -513,11 +513,10 @@
513513
514 Magick::Image lImage;514 Magick::Image lImage;
515 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);515 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
516 Item lItem;
517 // check if second argument was given516 // check if second argument was given
518 lImage.edge(ImageFunction::getOneUnsignedIntArg(aArgs,1));517 lImage.edge(ImageFunction::getOneUnsignedIntArg(aArgs,1));
519 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);518 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
520 lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());519 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
521 ImageFunction::checkIfItemIsNull(lItem);520 ImageFunction::checkIfItemIsNull(lItem);
522 return ItemSequence_t(new SingletonItemSequence(lItem));521 return ItemSequence_t(new SingletonItemSequence(lItem));
523}522}
@@ -541,7 +540,7 @@
541 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);540 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
542 lImage.charcoal(lRadius, lSigma);541 lImage.charcoal(lRadius, lSigma);
543 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);542 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
544 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());543 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
545 ImageFunction::checkIfItemIsNull(lItem);544 ImageFunction::checkIfItemIsNull(lItem);
546 return ItemSequence_t(new SingletonItemSequence(lItem));545 return ItemSequence_t(new SingletonItemSequence(lItem));
547}546}
@@ -566,7 +565,7 @@
566 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);565 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
567 lImage.emboss(lRadius, lSigma);566 lImage.emboss(lRadius, lSigma);
568 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);567 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
569 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());568 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
570 ImageFunction::checkIfItemIsNull(lItem);569 ImageFunction::checkIfItemIsNull(lItem);
571 return ItemSequence_t(new SingletonItemSequence(lItem));570 return ItemSequence_t(new SingletonItemSequence(lItem));
572}571}
@@ -590,7 +589,7 @@
590 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);589 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
591 lImage.solarize(lFactor);590 lImage.solarize(lFactor);
592 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);591 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
593 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());592 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
594 ImageFunction::checkIfItemIsNull(lItem);593 ImageFunction::checkIfItemIsNull(lItem);
595 return ItemSequence_t(new SingletonItemSequence(lItem));594 return ItemSequence_t(new SingletonItemSequence(lItem));
596}595}
@@ -618,7 +617,7 @@
618 }617 }
619 lFirstImage.stereo(lSecondImage);618 lFirstImage.stereo(lSecondImage);
620 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lFirstImage);619 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lFirstImage);
621 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());620 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
622 ImageFunction::checkIfItemIsNull(lItem);621 ImageFunction::checkIfItemIsNull(lItem);
623 return ItemSequence_t(new SingletonItemSequence(lItem));622 return ItemSequence_t(new SingletonItemSequence(lItem));
624}623}
@@ -653,7 +652,7 @@
653 sscanf(lTmpString.substr(5,2).c_str(), "%x", &lBlue);652 sscanf(lTmpString.substr(5,2).c_str(), "%x", &lBlue);
654 lImage.transparent(Magick::ColorRGB((double)lRed/255.0, (double)lGreen/255.0, (double)lBlue/255.0));653 lImage.transparent(Magick::ColorRGB((double)lRed/255.0, (double)lGreen/255.0, (double)lBlue/255.0));
655 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);654 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
656 lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());655 lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true);
657 ImageFunction::checkIfItemIsNull(lItem);656 ImageFunction::checkIfItemIsNull(lItem);
658 return ItemSequence_t(new SingletonItemSequence(lItem));657 return ItemSequence_t(new SingletonItemSequence(lItem));
659}658}
@@ -676,7 +675,7 @@
676 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);675 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
677 lImage.swirl(lDegrees);676 lImage.swirl(lDegrees);
678 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);677 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
679 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());678 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
680 ImageFunction::checkIfItemIsNull(lItem);679 ImageFunction::checkIfItemIsNull(lItem);
681 return ItemSequence_t(new SingletonItemSequence(lItem));680 return ItemSequence_t(new SingletonItemSequence(lItem));
682}681}
@@ -699,7 +698,7 @@
699 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);698 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
700 lImage.reduceNoise(lOrder);699 lImage.reduceNoise(lOrder);
701 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);700 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
702 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());701 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
703 ImageFunction::checkIfItemIsNull(lItem);702 ImageFunction::checkIfItemIsNull(lItem);
704 return ItemSequence_t(new SingletonItemSequence(lItem));703 return ItemSequence_t(new SingletonItemSequence(lItem));
705}704}
@@ -723,7 +722,7 @@
723 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);722 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
724 lImage.contrast(lSharpen);723 lImage.contrast(lSharpen);
725 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);724 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
726 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());725 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
727 ImageFunction::checkIfItemIsNull(lItem);726 ImageFunction::checkIfItemIsNull(lItem);
728 return ItemSequence_t(new SingletonItemSequence(lItem));727 return ItemSequence_t(new SingletonItemSequence(lItem));
729}728}
@@ -741,7 +740,6 @@
741 const StaticContext* aSctxCtx,740 const StaticContext* aSctxCtx,
742 const DynamicContext* aDynCtx) const741 const DynamicContext* aDynCtx) const
743{742{
744 Item lItem;
745 Magick::Image lImage;743 Magick::Image lImage;
746 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);744 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
747 // check if the one gamma value version was called or the version with seperate values for r g and b. Doing this by looking if the 3. argument exists.745 // check if the one gamma value version was called or the version with seperate values for r g and b. Doing this by looking if the 3. argument exists.
@@ -755,7 +753,7 @@
755 lImage.gamma(lGamma);753 lImage.gamma(lGamma);
756 } 754 }
757 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);755 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
758 lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());756 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
759 ImageFunction::checkIfItemIsNull(lItem);757 ImageFunction::checkIfItemIsNull(lItem);
760 return ItemSequence_t(new SingletonItemSequence(lItem));758 return ItemSequence_t(new SingletonItemSequence(lItem));
761}759}
@@ -778,7 +776,7 @@
778 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);776 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
779 lImage.implode(lFactor);777 lImage.implode(lFactor);
780 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);778 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
781 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());779 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
782 ImageFunction::checkIfItemIsNull(lItem);780 ImageFunction::checkIfItemIsNull(lItem);
783 return ItemSequence_t(new SingletonItemSequence(lItem));781 return ItemSequence_t(new SingletonItemSequence(lItem));
784}782}
@@ -802,7 +800,7 @@
802 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);800 ImageFunction::getOneImageArg(aDynCtx, aArgs, 0, lImage);
803 lImage.oilPaint(lRadius);801 lImage.oilPaint(lRadius);
804 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);802 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
805 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());803 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
806 ImageFunction::checkIfItemIsNull(lItem);804 ImageFunction::checkIfItemIsNull(lItem);
807 return ItemSequence_t(new SingletonItemSequence(lItem));805 return ItemSequence_t(new SingletonItemSequence(lItem));
808}806}
@@ -826,7 +824,7 @@
826 ImageFunction::getOneImageArg(aDynCtx, aArgs, 1, lImage);824 ImageFunction::getOneImageArg(aDynCtx, aArgs, 1, lImage);
827 lImage.stegano(lWatermark);825 lImage.stegano(lWatermark);
828 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);826 String lEncodedContent = ImageFunction::getEncodedStringFromImage(aDynCtx, lImage);
829 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());827 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true) );
830 ImageFunction::checkIfItemIsNull(lItem);828 ImageFunction::checkIfItemIsNull(lItem);
831 return ItemSequence_t(new SingletonItemSequence(lItem));829 return ItemSequence_t(new SingletonItemSequence(lItem));
832}830}
@@ -847,3 +845,5 @@
847extern "C" DLL_EXPORT zorba::ExternalModule* createModule() {845extern "C" DLL_EXPORT zorba::ExternalModule* createModule() {
848 return new zorba::imagemodule::manipulationmodule::ManipulationModule();846 return new zorba::imagemodule::manipulationmodule::ManipulationModule();
849}847}
848
849/* vim:set et sw=2 ts=2: */
850850
=== modified file 'src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp'
--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp 2011-10-06 08:18:47 +0000
+++ src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp 2013-06-22 13:12:26 +0000
@@ -60,7 +60,7 @@
6060
61 // pass the blob back as base64Binary ...61 // pass the blob back as base64Binary ...
62 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob);62 String lEncodedContent = ImageFunction::getEncodedStringFromBlob(lBlob);
63 Item lItem = theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size());63 Item lItem( theModule->getItemFactory()->createBase64Binary(lEncodedContent.c_str(), lEncodedContent.size(), true));
64 ImageFunction::checkIfItemIsNull(lItem);64 ImageFunction::checkIfItemIsNull(lItem);
65 return ItemSequence_t(new SingletonItemSequence(lItem));65 return ItemSequence_t(new SingletonItemSequence(lItem));
6666

Subscribers

People subscribed via source and target branches

to all changes: