How can you get the "var svgData" out of an image? - string

Ive been trying to figure out how to code a image into a "var svgData" code for quite some time, yet i only found one similar question in the internet with no helpful solution. There is a webisite called "gtalogo" (http://gtalogo.com/), where you can basically look for emblems you want to apply to your gta crew.
But in order to upload a image on the website, you need a "var svgData='(Code)=';var layerData='(another Code)='" first, and I have no idea how you can get that code out of a svg file, png file, jpg file, or whatever.
Ive tried to convert svg to base64, but that didnt solve the problem because there is still the "var layerData".
I can give you a example of one image which is on the gtalogo webiste, and got coded into "var svgData".
image: https://en.gtalogo.com/img/16479.webp
code: (too long), but you can see it on this link, when you click on "show code": https://en.gtalogo.com/emblem-16479.html". This is a random emblem btw.
And my task is to get the "var svgData" code, which you saw on the website, out of my image. This is the image: My image
(no questions asked (im not a communist)).
And this is the svg: https://mega.nz/file/HGJlCIQS#iOlt6jdVDGJV98Ay_HpnHudtB94rncehgCnKQgq39GY
Base64 code if you need it: https://mega.nz/file/yGRFjQCK#uslnTQe5kqxqE1RJABXnGeBkmxZ19fVPQeiPjg253ks
So, if someone knows what im talking about and is able to describe me how i can get the var svgData code, or is able to code it for me, it would be very appreciated.
TrileX_

svgData is not tied to the image itself. It's a value that Rockstar services create for each of the emblems that are successfully created.
[EDIT: While svgData is actually tied to the image and can be easily reproduced, but you still need layerData which is from Rockstar editor]
To upload an image to "gtalogo" you need to use a command in console (copy(_sc_av_edit+'|||'+document.getElementById("emblemEditor-canvasContainer").innerHTML)). First part is the code generated by Rockstar and the second part is the vector image itself.
While the second part you can get without any issues, the first part you can only get from an already saved emblem (as far as I know).
In conclusion, you either have to use a pre-existing emblem or make one yourself in the Rockstar emblem editor.

Related

Is there a way to automatically turn text into hyperlinks in Processing?

I'm brand new to programming in general, but specifically Processing, and I need some help on a final project for my digital media class! Using a QR Code Reader library, I've made a sketch in Processing that successfully reads any QR code I throw at it. For the next step, I wanted to find a way to turn the url my sketch displays into a working hyperlink. I want to be able to scan the code, display the url, and click on the url and have it open in my browser. I have steps one and two, but if anyone knows how to write step 3, I'm in desperate need of some advice!
This is the first time in my life I've ever had to code (I'm studying creative writing), and I have yet to get a response on any other forums, so I'd really appreciate the help! Thank you!
I don't know about clicking on text, but there is a way to open a URL in a browser!
You use the link() command. I can't actually find it on the reference page, but it takes a single argument, the URL you want to open.
Here is the example from Processing.org.

Why won't Azure OCR code loop through media?

I'm trying to get a project going where I can extract text from JPGs, PNGs, and PDFs. I found this article where someone made something similar
I tried following this person's guide and tried tying it to my Azure instance, but when I run the code (basically copied exactly what he did), I get an error of KeyError: 'regions'
Any idea what the issue may be? I have the error screenshot below, as well as the code (with my API key and endpoint removed.
So turns out I was just using the wrong end point in the code. I was copying what was given to me in Azure and not what the guy had in his video. Ooops

Jade aka Pug syntax for iteration

I am trying to iterate over a variable in jade with each. the variable, in this case is interpolate like so #{images}. The array contains urls for images.
I can do img(src="#{images[0]}") and it works fine
I try to use the each functions and keep coming up with errors. This is the latest attempt.
div
each image in #{images}
img(src="#{image}",height="100px",width="100px")
i have tried without interpolating image. and a bunch of other stuff. is there something i am missing with the space or syntax?
img(src="#{images[0]}",height="100px",width="100px")
the above works so i know im getting the variable, again this is with jade extensions. i tried to migrate this little project to pug but that didnt work, but thats another story.
this is last piece in a pretty cool uploader that uses POST from the browser to upload images to an aws bucket while saving the urls in a mongoDB. figuring this out will add an image gallery to view the uploads.
So after much hassle I have figured it out. This rule should apply to most scenarios when you send an array as a variable from express over into your jade/pug template.
My issue was that I was trying to interpolate my images variable within the each loop. You interpolate like this: #{variable}. That will produce the literal version of your variable, but that is not what is needed in an each loop. You just want the name of the variable, not the literal value.
Instead the code that works is ridiculously simple.
Wrong:
each image in #{images}
img(src="#{image}",height="100px",width="100px")
Right
each image in images
img(src="#{image}",height="100px",width="100px")
Now the loop is creating a new image with a src from each value in my var images=[url,url,etc]
This jade/pug syntax is a bit confusing at first, but seems to be great if you can figure it out.

Obfuscate Images in EaselJS

Is there any way to protect your sprites on EaselJS?
Currently is too easy to download the sprites.
On chrome just go to console -> resources like this
I made a resarch before i made this answer and found this topic .
That could be very nice. Also we don't need to save the slices in a json like he said, if we have a shuffle seed.
But, i didn't find any thing in nodejs(back-end) to make this image shuffle.
I tried Node GM but its looks too complicaded to bind a image on top of another with (w,h,x,y,offsetX,offsetY)
I know always will have a way to "hack" the resource. But at least offer some difficult.
One of the simple approaches is to encode images to base64, store them as part of Javascript and decode at runtime. See:
Convert and insert Base64 data to Canvas in Javascript
But obviously this will increase download size.
Personally, I would not go this route for "normal" applications or games, unless it is really justified or put on me as an external requirement. For example, one can easily extract assets from the android APK, but this does not seem an area of concern for most of the developers.
The user's browser downloads those images whether you want it or not. Otherwise, they wouldn't be able to display them.
At any given time, any user can just right click on any image on the site and click SAVE AS, you can't stop it, and you shouldn't try.
If you don't want people downloading your work, don't put it on the public facing internet.

FlashChartHelper for OpenFlashChart2 in CakePHP: blank charts

So I have recently started playing with Ubuntu, PHP, and CakePHP and have been pretty happy with the LAMP stack. Except now I'm trying to build a simple web page that can display collected data in a graph. Apparently OpenFlashChart2 with the FlashChartHelper plugin is pretty good, but I cannot get it to actually display a graph. I got the "hello world" sample described in the OpenFlashChart2 documentation to work, but when I try the FlashChartHelper samples I just get a blank spot where my graph is supposed to be. There is no error message, just... nothing. I verified that all the files are installed as listed on the page, and I made sure to define $helpers in my controller
var $helpers = array('Html', 'Form', 'Flash','FlashChart');
Could it be a pathing issue? My webroot is /var/www/, but I unzipped cake into /var/www/www2/ . The rest of my site, including entering data, works just fine.
Has anyone else seen this before? What did you do to resolve the issue? Failing that, can you recommend another graphing library? Specifically, I need to render a scatter graph. I have a collection of data points that are collected at irregular intervals. Either suggestions on fixing FlashChartHelper or another library would be appreciated
I would perhaps take a look at this resource:
[http://www.littlehart.net/atthekeyboard/2006/09/26/tutorial-integrating-phpswf-charts-with-cakephp/][1]
It seems to have everything you need?

Resources