Serial Code

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Serial Code

Post by jwtea » Tue Apr 03, 2018 3:28 am

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!

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Serial Code

Post by jwtea » Tue Apr 03, 2018 5:28 am

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??

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Serial Code

Post by FourthWorld » Tue Apr 03, 2018 5:40 am

Does it need to be used outside your app, or just as a document to be viewed in your app only?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Serial Code

Post by jwtea » Tue Apr 03, 2018 6:50 am

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!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Serial Code

Post by FourthWorld » Tue Apr 03, 2018 7:31 am

What would the serial code to in other programs? And which image format, PNG, JPEG, GIF, or something else?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Serial Code

Post by jwtea » Tue Apr 03, 2018 7:43 am

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Serial Code

Post by richmond62 » Tue Apr 03, 2018 8:07 am

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?

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Serial Code

Post by jwtea » Tue Apr 03, 2018 8:13 am

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!!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Serial Code

Post by FourthWorld » Tue Apr 03, 2018 7:39 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Serial Code

Post by jwtea » Wed Apr 04, 2018 2:37 pm

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Serial Code

Post by FourthWorld » Wed Apr 04, 2018 4:14 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Serial Code

Post by jacque » Wed Apr 04, 2018 4:45 pm

Can you just create a snapshot of the combined controls?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Talking LiveCode”