set image quality on ezpublish 5 - symfony

Is it possible to set quality for png images on ezpublish 2014.11 in `image_variations' config.
I'm looking for something like this :
media:
reference: null
quality: 50
filters:
- { name: geometry/scalewidthdownonly, params: [100] }
I found ezpublish doc on alias, but it seems limited to jpeg.
I found jpegoptim liip post processor, but liip imagine doesn't seems to have an optipng post processor.
So my guess is that I'll have to build my own post processor based on the jpegoptim one.
Any simpler solution ?

These rather new liip imagine bundle setting / feature(s) are not supported 'directly' (today) in eZ Publish 5.4 (Community Build 2014.11 or latest composer / GitHub sources).
This has been discussed previously: http://share.ez.no/forums/ez-publish-5-platform/ez-5.4-image-variations-jpeg-quality
http://share.ez.no/forums/discussions/new-in-ez-5.4-image-alias-system-revamped/(order)/latest
Rumor has it that this will be addressed in the future but no specific commitments have yet been publicly made. There is an existing issue ticket for this concern: https://jira.ez.no/browse/EZP-24167
A user did find a partial work around that they shared as helpful but not quite perfect: http://share.ez.no/forums/ez-publish-5-platform/ez-5.4-image-variations-jpeg-quality/comment86157

Related

SilverStripe 4 with fluent: "Table 'ss4_project.Member_Localised' doesn't exist"

I've got fresh project using SilverStripe 4.8 and fluent 5.0.0. I've added an extension to the Member and the fluent extension with fields to translate:
SilverStripe\Security\Member:
extensions:
- MemberExtension
- TractorCow\Fluent\Extension\FluentExtension
translate:
- ShortDesc
- Description
Seems pretty standard, but I get Table 'ss4_project.Member_Localised' doesn't exist during dev/build. I've tried without the translate fields as well as in a different configuration loaded after the member extension. No luck.
I have the feeling I'm missing something obvious.
Any clues are appreciated.
On Github, I've got the following solution:
Security::force_database_is_ready(false); // only during dev/build
to switch of the protection for core table temporary.
For details see https://github.com/tractorcow-farm/silverstripe-fluent/issues/725

Symfony 5 hanndle access for external tools (knpsnappy)

In a Symfony 5.x project I use knplabs/knp-snappy-bundle.
Having private data-folders for different users results in generating PDF-documents that require images from folders which are not publicly accessable.
When trying to generate a PDF-document with an image in such a folder knpsnappy runs into a 60 sec timeout. The Symfony log says
Guard authenticator does not support the request.
I assume something regarding the "external" tool knpsnappy calling from outside the application but from the same server but does not triggering any security definition I defined.
I am unsure on how to allow knpsnappy to access a specific route.
Maybe someone can lead me into the right direction...?
I was misslead.
The cause of the problem wasn't access rights but the way the img-pathes were defined.
knp snappy wont be able to render images with URL-routes.
I switched the pathes to be absolut server pathes and now it works.
Found the solution here:
KnpSnappyBundle and Symfony 3.4 : images and/or css cause timeout

symfony debug:true does what?

I've been searching symfony docs and SO for an explanation of what changing symfony's debug flag to true does exactly. I feel stupid for not finding it ... can anyone provide a link to the doc?
Read Working with environments for more informations about the debug.
You are right, the Symfony Documentation related to the Debug component will help for use it but not give detailed explanations about the features added to the environment.
If you use debug=true in your environment, you will get the debug-bar containig all informations related to your environment, and other features related to debug in a PHP framework.
I will list the main additional features added by enabling debug :
Toolbar added with all informations about requests, security, deprecations, translations, configuration, and errors in your current request.
Cache files are dynamically rebuilt on each request.
Enable debugging features in packages and third-party libraries based on debug (such as Twig dump)
Errors displaying are no longer managed by the debug, it's just configured in the front-controller (e.g. app_dev.php and app.php)
Informations coming from Configuration and environments
Symfony documentation is very vast and it's surely not the bigger part, but very important to know, I discover it too.

Reference docs for Azure Resource Templates

I am looking for reference docs for the Azure Resource Manager JSON templates. Does anyone know if there is reference material for these templates?
There is general reference for required parameters etc like at Create a template deployment.
I am basically looking for the full availability so I can correspond setup on the portal to the JSON template. Also availability of features with apiVersion releases. I remember there being a MSDN documentation for the changelog with api version releases but cannot find it now.
If you create a VM with the desired settings, extensions etc then you can view their json template via https://resources.azure.com/
This will give some visibility into the Classic* templates.
All of the ARM templates can be found on GitHub here: https://github.com/Azure/azure-resource-manager-schemas.
It includes preview templates and should provide all the information you're after to determine which features are present in which apiVersion release.
Microsoft has finally created what I was looking for 🎉: full documentation is now available at https://learn.microsoft.com/en-au/azure/templates/
After some digging I managed to get the following list of schemas:
http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json
http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json
http://schema.management.azure.com/schemas/2014-04-01-preview/Microsoft.Sql.json
http://schema.management.azure.com/schemas/2014-04-01/Microsoft.Insights.json
http://schema.management.azure.com/schemas/2014-02-26/microsoft.visualstudio.json
http://schema.management.azure.com/schemas/2014-04-01-preview/Microsoft.Cache.json
http://schema.management.azure.com/schemas/2014-04-01/Microsoft.BizTalkServices.json
http://schema.management.azure.com/schemas/2014-08-01/Microsoft.Scheduler.json
http://schema.management.azure.com/schemas/2014-04-01/SuccessBricks.ClearDB.json
http://schema.management.azure.com/schemas/2015-01-01/Microsoft.Resources.json
http://schema.management.azure.com/schemas/2015-01-01/Microsoft.Authorization.json
http://schema.management.azure.com/schemas/2014-10-01-preview/Microsoft.Authorization.json
This list notably excludes:
Microsoft.ClassicCompute
Microsoft.ClassicStorage
Microsoft.ClassicNetwork
So I guess we're left to figure stuff out from the templates on those
To my mind we can dig that way:
open the azure-resource-manager schemas
Look at the main form below:
If you open properties, you will find the format that we need to fill:
open parameters and look at the structure:
$ref: #/definitions/parameter invite us to look at the same documents in definitions.parameters where you will find some documentation (like value you can use etc):
finally, if you look to properties.resources, you will find a list of url like:
{ "$ref": "http://schema.management.azure.com/schemas/2015-07-01-preview/Microsoft.ServerManagement.json#/resourceDefinitions/node" }
{ "$ref": "http://schema.management.azure.com/schemas/2015-07-01-preview/Microsoft.ServerManagement.json#/resourceDefinitions/gateway" }
if you open one of these url, you will find the JSON format you are looking for (here is a part of the first one):
There is not much available...
Azure Resource Manager Template Language
https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/
And then you can look at the different json.schemas that I have managed to find
deploymentTemplate
http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json
visualstudio
http://schema.management.azure.com/schemas/2014-02-26/microsoft.visualstudio.json
Sql
http://schema.management.azure.com/schemas/2014-06-01/2014-04-01-preview/Microsoft.Sql.json
Web
http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json
deploymentParameters
http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentParameters.json
If you use Visual Studio to edit the json-template file you get intellisense (sometimes) which help a bit. But the lack of documentation is really annoying...for example I have no clue if the schemas listed above are the most recent or not, and I have no idea where to find which one is the most resent.
Edit:
I came across the list of additions and changes to the Service Management APIs. Seems to be a bit outdated, 2015-01-01 is the current version and it's not there.
Edit2:
With the Iaas updates at Build 2015, there seems to also be a lot of Azure Quickstart Templates. At minimum, they have the particular cases I was looking for with storage accounts.

How can I tell if Netbeans 7.3 and Symfony2 is working properly?

I have recently followed the common advice found on the internet on how to install Symfony2 in Netbeans 7.3 by pointing the configuration to the Symfony2 standard edition zip file.
Now I'm following the book on the Symfony website to create the HelloBundle demo, and I'm noticing some inconsistencies.
First, when running a Symfony command in Netbeans, the generate bundle does not work as the book says it should. It forces me to use the --dir option. Here are the parameters I had to add:
--namespace=Acme/HelloBundle --format=yml --dir=src
Secondly, I see the routing file that was created, but the route parameters are different than what the book says. First the term "Pattern" is used instead of "Path." Further searching indicates that "Pattern" is an obsolete term and that "Path" is preferred now. If this is the case, then why is "Pattern" showing up in my files if I'm using the most current version of the framework (2.3.1)? Also, my routing file has the word "Default" in it while the book has "Hello." Here is a copy of the output.
acme_hello_homepage:
pattern: /hello/{name}
defaults: { _controller: AcmeHelloBundle:Default:index }
Finally, the book is unclear as to whether or not creating the bundle also automatically creates the controller files. Is this the case? I do not have "HelloController.php" file the books says I should be editing.
I'm new to Symfony, but this feels a little off. If that's the case how do I configure it to work as it should?
I'm using Netbeans as IDE for my symfony 2.x projects, i can't tell what's the problem with your Netbeans configuration, but here's a guide that can help setting-up things :)
http://software-talk.org/blog/2012/06/symfony2-tutorial-netbeans-and-symfony2-setting-everything-up/
Hope it helps.

Resources