How to support webp format images on imagemagick running on cloud functions for firebase? - firebase

I'm getting this error whenever I try to process an image with the webp format
Failed to blur image. { Error: Command failed: composite -gravity SouthWest /tmp/AppLogo.png /tmp/funny.webp /tmp/funny.webp
composite: delegate failed "dwebp" -pam "%i" -o "%o"' # error/delegate.c/InvokeDelegate/1310.
composite: unable to open image/tmp/magick-255i74iCxeR7SM': No such file or directory # error/blob.c/OpenBlob/2712.
If I should to install the right delegates for this format how should I write firebase Command CLI to do that for me ?Please help.
AskFirebase

The ImageMagick binary provided by Cloud Functions doesn't support webp, and that's not likely to change in the near future. Consider instead providing your own compiled ImageMagick and bundle it with your functions. Or, even better, use a node module that natively supports webp, such as Sharp (which also claims to be faster than ImageMagick). There is official sample code that uses this module.

Related

how to upload a tflite file to firebase test lab device via gcloud?

It is known that additional files can be uploaded via the other files flag in gcloud.
I am trying to use the firebase test lab performance application to check the performance of a network.
The command i run is:
gcloud firebase test android run --type=game-loop --app=bazel-bin/tensorflow/lite/tools/benchmark/experimental/firebase/android/benchmark_model_firebase.apk --device model=flame,version=29 --other-files=/data/local/tmp/graph=network1.tflite
The command crashes with the error:
ERROR: gcloud crashed (InvalidUserInputError): Could not guess mime type for network1.tflite
Is there a way to circumvent the problem or somehow pass the mime type to the command line ?
I found a crazy workaround. I renamed the tflite file to so so the mimetypes library gave it an octet stream mime type and everything worked.
gcloud firebase test android run --type=game-loop --app=bazel-bin/tensorflow/lite/tools/benchmark/experimental/firebase/android/benchmark_model_firebase.apk --device model=flame,version=29 --other-files=/data/local/tmp/graph=network1.so
Opened an issue in google: https://issuetracker.google.com/issues/196230363

Wine Cannot Load the Necessary Libraries in a Google Colab Instance

I have a notebook in Google Colab I am trying to use run a windows program, but I always get the same library error:
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
I have tried to !find libtcmalloc.so.4 libtcmalloc-minimal4 but never seem to locate the library I need anywhere on the system. I had assumed that libtmalloc was installed with libgoogle-perftools-dev but I guess not?

command line compiling generates bigger file than the online version

I am testing google closure compiler on command line.
I took the latest version :
java -jar closure-compiler.jar --version
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20190618
Built on: 2019-06-21 17:24
I am generating a compressed version of my javascript like this :
java -jar closure-compiler.jar my_script.js > out.js
The problem is that the generated code is bigger than the one I get when I use the online service at https://closure-compiler.appspot.com/home
I noticed that the command line version added, at the beginning, the following code :
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
I do not have such a code in my script: Where does it come from ?
how can I produce the same output as the online version ?
To get the compiler command line work as the web service, I just added an option :
--language_out=ECMASCRIPT_2015
This is likely a discrepancy between the settings on the web service and the ones you're using locally.
Have a look at a Closure Compiler: Flags and Options to see what settings you might prefer.
If you'd share your source, it'd be possible to try and help you narrow down the options.
As for the extra code, I believe it is at least partially a polyfill for Array.prototype.find (aka [].find), which I assume is in your code?
If so, that's Closure injecting code to improve your cross browser compatibility.

trigger.io - Can't create ipa-file anymore

I usually use trigger.io to generate my ipa-Files for iOS. Now when I want to generate the file, I get the following error message:
Failed when running /usr/bin/codesign: codesign_allocate: object: /Users/mherceg/Desktop/ag-app/development/ios/device-ios.app/Forge malformed object (unknown load command 39)
/Users/mherceg/Desktop/ag-app/development/ios/device-ios.app: object file format unrecognized, invalid, or unsuitable
It worked yesterday, but now it doesn't. Any help is very welcome.
Thanks,
enne
This is probably to do with v1.4.16 of our platform, where we switched over to building on Xcode 4.5: I'd recommend upgrading Xcode and make sure the Command-line Tools (Preferences ↦ Downloads) are installed.

How to use QCA library in Qt

I have used QCA (qca-2.0.1-mingw) library for encryption.
I have searched some code and write into the application. But it does not support the AES encryption standard.
e.g
QCA::supportedFeatures();
QCA::isSupported("aes128-cbc-pkcs7");
shows the o/p
("random", "md5", "sha1", "keystorelist")
false
Why AES is not supported ?
Thanx.. Frank and elmigranto
now, i have download qca-ossl-2.0.0-beta3 form link and also install the OpenSSl(Win32OpenSSL-1_0_0j.exe).then i build it by follows this link
configwin rd
Configuring for release and debug, dynamic
Wrote conf_win.pri
qmake
C:\qca-ossl-2.0.0-beta3>qmake
'qmake' is not recognized as an internal or external command,
operable program or batch file.
Also when i build the qca-ossl.pro file it shows o/p as:
c:\qca-ossl-2.0.0-beta3\qca-ossl.pro:17: warning: Unable to find file for inclusion winlocal.prf
what to do next? pls help me guys..

Resources