I have written a service that checks a folder for image files, resizes
and updates the Product in OFBiz based on the file name equaling the
productId. It works for a few hundred images, but when I process a few
thousand images at the end it hits a transaction timeout. All the images
are resized and saved. But the product records don't get updated. All
I'm doing in the database is updating the Product image fields, is there
a way to force the commit on each product instead at the end of the
On 1/26/2018 12:48 AM, Jacques Le Roux wrote:
That's an interesting information!
Le 26/01/2018 à 02:57, Shi Jinghai a écrit :
Thanks Mike, I agree with you if such image processing happens
regularly, perl is a good choice but system may be complicated.
The image processing speed of JDK 7 is dramatically slower than JDK
6, and sometimes wrong, as Kodak and others withdrew their image
algorithm properties when Java transferred from Sun to Oracle.
Java will struggle on ImageIO for a while, hope JDK 9 have a big
发件人: Mike [mailto:mz4whee...@gmail.com]
发送时间: 2018年1月26日 0:26
抄送: Shi Jinghai
主题: Re: data import - product images
A well written perl or shell script can take "original.jpg" in
directory "x" and create, multiple larger/smaller images with the
same "root" name. You can use image magic, an image processor
package, to do this. Basic stuff for anyone who knows shell scripting.
You can then import these images using a single XML data_reader file,
and import it into OFB. Example:
<?xml version="1.0" encoding="UTF-8"?>
[plus 1000s more].....
A single script can generate the above XML file (with 1000s of
products), resize 1000s of "original.jpg" into multiple images, and
import into OFB, all in one pass. Standard stuff for anyone
competent with perl/shell scripting.
What you don't want is make java do busy, CPU intensive work and have
it render different sizes "on the fly", if that is what you are
On Wed, Jan 24, 2018 at 11:56 PM, Jesse Thomas
Thanks Shi and Rishi for the responses.
I was hoping to do this the hard way and l learn some new tricks in
the process. More specifically I was hoping to use a ftl template
(like in ./specialpurpose/ecommerce/data/DemoTree.xml) to call a
service or function directly. Making the solution 100% OFB.
If you know of any examples or clues please let me know.
On 1/24/2018 11:27 PM, Shi Jinghai wrote:
On generating the other sizes needed, it's already in the source
发件人: Jesse Thomas
发送时间: 2018年1月24日 15:30
主题: data import - product images
Is there is a way of using a data reader to load a product image and
have it treated as though its uploaded as an "Original Image"
(generating the other sizes needed)? Or whats the best way to load
images during data migration?
The images are available in the file system and via http, several
thousand of them. Thanks in advance for any help or advice!