Page 1 of 1

Serial Code

Posted: Tue Apr 03, 2018 3:28 am
by jwtea
Hello everybody,

I'm actually figuring on how to come out a serial code stamp application.

Basically, this application can allow user to upload image to livecode and the user can
click on anywhere of the image and there a option for user to key in the serial code content of example from "0" to "100" to the image. Then i will press "generate" button, the serial code will be stamped in the image at the location i click on.

So the end outcome will be like saving 100 images but each image will have different serial code.

Anyone know any link or article i can read up to make this happen?
or the code for this to work?

Appreciated and thanks!

Re: Serial Code

Posted: Tue Apr 03, 2018 5:28 am
by jwtea
UPDATE:

I had some progress now i'm stuck at saving image with the textfield at the image.

How can i save the image together with the textfield as 1 image??

Re: Serial Code

Posted: Tue Apr 03, 2018 5:40 am
by FourthWorld
Does it need to be used outside your app, or just as a document to be viewed in your app only?

Re: Serial Code

Posted: Tue Apr 03, 2018 6:50 am
by jwtea
Hello FouthWorld,

The saved image should be outside the app like example save the image with the serial code to the desktop!

Thanks for your response & time!

Re: Serial Code

Posted: Tue Apr 03, 2018 7:31 am
by FourthWorld
What would the serial code to in other programs? And which image format, PNG, JPEG, GIF, or something else?

Re: Serial Code

Posted: Tue Apr 03, 2018 7:43 am
by jwtea
Hello Fourthworld,
Basically the serial code is a field which is enter by the user and the image format will be the original format
example, they upload PNG format image to the app then they enter the serial code in the field.
After that they press a button, the serial code will be in the image and saved to desktop.

Re: Serial Code

Posted: Tue Apr 03, 2018 8:07 am
by richmond62
the serial code will be in the image
How?

Surely? The best way to do this is to import an image as TEXT into a textField,
append your serial number and export it again, making sure that it retains its suffix as a picture?

Re: Serial Code

Posted: Tue Apr 03, 2018 8:13 am
by jwtea
Hello richmond62,

can i know more in details on how to import an image as a text and append the serial number and to export??

Thanks for your response!!

Re: Serial Code

Posted: Tue Apr 03, 2018 7:39 pm
by FourthWorld
Can you tell us more about the purpose of this serial number, how it will be used? There may be ways to tuck it into the comments portion of a PNG file, or you might consider steganography, but the best approach will depend on why this is being done.

Re: Serial Code

Posted: Wed Apr 04, 2018 2:37 pm
by jwtea
Hello Fourthworld, this serial number work like a voucher etc.

Putting variable field on the image and when you save the image it will be the image + variable field as one.

Re: Serial Code

Posted: Wed Apr 04, 2018 4:14 pm
by FourthWorld
If the resulting file were to be used only in your app you have many options available, most quite easy to implement.

But if you want the image to be readable in other apps after you modify it, you are limited to either some form of steganography or using whatever metadata options are available for the image format.

This library will handle the Exif data in JPEG, and may inspire you to learn about the metadata options for PNG:
https://github.com/angerangel/livecodeE ... /README.md

Note that any use of standard metadata options for an image file will mean that the user will be able to view and edit whatever you put there.

Also, many programs that re-save an image often strip the file of its metadata. Uploading to Facebook or even many image archive services will alter or remove metadata in the image file by default.

It's very difficult to embed non-image data into an image file using a standard format in such a way that ensures the metadata will not be altered.

Even most steganography fails with recompression it the image data, though there is in recent years at least one algo which claims to be able to survive Facebook's recompression. Given the complexity and rarity of steganography I am not familiar with LiveCode libraries for it.

This is why I asked about the goal of this exercise. You've described *what* you want to do, but not yet *why* you want to do it. There may be other ways to satisfy that *why* beyond what comes to mind right now. That's the power of community brainstorming.

But if user-editable options are fine, the library above will get you started with JPEG.

Re: Serial Code

Posted: Wed Apr 04, 2018 4:45 pm
by jacque
Can you just create a snapshot of the combined controls?