DMXzone Image Processor Support Product Page

create a second set of images

Asked 14 Aug 2020 09:41:19
1
has this question
14 Aug 2020 09:41:19 Charles Knight posted:
Hi,

I have a server action which uploads multiple images, adds a watermark and creates three versions each with its own file name, lg_{{imagename}}.{{ext}}, md_{{imagename}}.{{ext}}, sm_{{imagename}}.{{ext}}. The image's path's are then inserted into an image database.

The sequence is as follows:
File Upload: uploadimages
Repeat repeatupload: {{uploadimages}}
exec
steps
Load Image:image1
Resize Image (800 wide)
Watermark Image
Save Image (lg_{{imageName}}.{{ext}})
Resize Image (300 wide)
Save Image (md_{{imageName}}.{{ext}})
Resize Image (120 wide)
Save Image (sm_{{imageName}}.{{ext}})
Database Connection
Databaseinsert

My question is; how do I create a second set of images from the original uploads, I need a second set with a different watermark and with a different folder location and filename sequence?

Do I add another 'load image' so 'Load Image 2' under steps and run on using the sane technique as above or am I meant to create another repeat, what is the best solution?

Many thanks
Charles K

Replies

Replied 19 Aug 2020 12:34:01
19 Aug 2020 12:34:01 Teodor Kuduschiev replied:
Hello,
You can just use another set of Load Image and image manipulation steps after it ...
Replied 19 Aug 2020 16:47:46
19 Aug 2020 16:47:46 Charles Knight replied:
I tried that but the sheer act of changing The Server Action has now stopped the original sequence working properly, now the watermark fails to appear on the first image but does appear on the second and third image - bizarre!

What files would I have to delete to start over with a clean sheet, it’s seems to me as though something somewhere is not getting updated correctly?
Replied 27 Aug 2020 10:20:01
27 Aug 2020 10:20:01 Teodor Kuduschiev replied:
Quotenow the watermark fails to appear on the first image but does appear on the second and third image


Are you sure there is no some save image step which overwrites the watermarked image with an image having the same name?
Replied 27 Aug 2020 10:41:45
27 Aug 2020 10:41:45 Charles Knight replied:
That was from an earlier attempt to get the watermark working, now as soon as I add the watermark the action stops at the watermark step, I can tell this because the first image is uploaded but not resized or saved in the db.

Should I send you the server action file to look at?
Replied 27 Aug 2020 10:53:09
27 Aug 2020 10:53:09 Teodor Kuduschiev replied:
Replied 27 Aug 2020 14:38:38
27 Aug 2020 14:38:38 Charles Knight replied:
resource was in the wrong place however now I'm back to the original problem, watermark appears on medium and small version but not the first large image
Replied 27 Aug 2020 14:43:55
27 Aug 2020 14:43:55 Teodor Kuduschiev replied:
Well that's not the error we are looking for.
As it is explained in the video check Network > XHR to see the EXACT error message returned ...

prntscr.com/u6xabk
Replied 27 Aug 2020 15:15:11
27 Aug 2020 15:15:11 Charles Knight replied:
There is no longer an error as the server action completes and forwards me to a related page, as mentioned above the image which is resized first does not get watermarked but the second two do....
Replied 27 Aug 2020 15:21:53
27 Aug 2020 15:21:53 Teodor Kuduschiev replied:
So, again my question:


QuoteAre you sure there is no some save image step which overwrites the watermarked image with an image having the same name?

Replied 27 Aug 2020 15:39:26
27 Aug 2020 15:39:26 Charles Knight replied:
Overwritten wasn't checked so it was the original image was being left instead of the resized one, the reason it failed was file type was set to auto rather than jpeg.

Now the second set of images has two watermarks so I'm guessing I have to do a second upload of the same images so I have a fresh set to watermark.
Replied 27 Aug 2020 16:33:31
27 Aug 2020 16:33:31 Charles Knight replied:
OK, so have fixed watermark issue but second set of images have two watermarks from them which doesn't seem to make sense.

My sequence is;
fileupload - multiple images

repeat upload of multiple images,

load image,
resize,
watermark
save
resize
save
resize save

Then load image again ( which should be a clean original from the initial upload)
resize
watermark (different logo this time)
save
resize
save
resize
save

connect to db
insert image details into db

Its as if the second upload is the image already with the water mark from the first upload.

Do I need to do a second repeat and then the load image?
Replied 28 Aug 2020 07:24:52
28 Aug 2020 07:24:52 Teodor Kuduschiev replied:
Make sure the first set of manipulations does not save the image in the same folder or with the same name as the originally uploaded one.
Replied 28 Aug 2020 08:29:23
28 Aug 2020 08:29:23 Charles Knight replied:
second set of images does save to a different location and all have a different file name structure so that's not the problem.

Tried to create an action with a second repeat but still the second set of images have two watermarks on them.

Logically the original images uploaded are being overwritten and have the first watermark so the second upload is not using the original images, I don't know how to get round this
Replied 28 Aug 2020 08:53:01
28 Aug 2020 08:53:01 Teodor Kuduschiev replied:
I am not sure i understand what you mean by:

QuoteLogically the original images uploaded are being overwritten and have the first watermark so the second upload is not using the original images, I don't know how to get round this



They SHOULD not be overwritten, as then you are using them in the second load step ... you need to:

- Upload image
- Load the uploaded image, process and save using a different name or folder!
- Load the uploaded image (as it has not been overwritten you won't have a watermark on it), process and save.

Reply to this topic