Incorrect match_any filter parsing

Describe the bug
The filter parser somehow produces the wrong match_any query.
Given:
"match_any" => [
  %{"comparator" => "eq", "field" => "from_account.id", "value" => "acc_01d744xjbq2b77jq2wb20qt8e5"},
  %{"comparator" => "eq", "field" => "to_account.id", "value" => "acc_01d744xjbq2b77jq2wb20qt8e5"}
]

Translates to:
left_join: w1 in EWalletDB.Wallet, on: w1.address == t0.from,
left_join: a2 in EWalletDB.Account, on: a2.uuid == t0.to_account_uuid,
left_join: a3 in EWalletDB.Account, on: a3.uuid == t0.from_account_uuid,
where: a2.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5" or (w1.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5 or ^false)"

But the correct translation should be:
where: a2.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5" or (a3.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5 or ^false)"

To Reproduce
[info] POST /api/admin/transaction.all
[debug] QUERY OK source="user" db=1.0ms queue=0.1ms
SELECT u0."uuid", u0."id", u0."is_admin", u0."global_role", u0."username", u0."full_name", u0."calling_name", u0."email", u0."password_hash", u0."provider_user_id", u0."metadata", u0."encrypted_metadata", u0."avatar", u0."enabled", u0."enabled_2fa_at", u0."backup_codes_created_at", u0."secret_2fa_code", u0."invite_uuid", u0."inserted_at", u0."updated_at" FROM "user" AS u0 WHERE (u0."id" = $1) ["usr_01d744xjt6bzv8bmwkb00t5gh0"]
[debug] QUERY OK source="wallet" db=0.7ms
SELECT w0."uuid", w0."address", w0."name", w0."identifier", w0."metadata", w0."encrypted_metadata", w0."enabled", w0."user_uuid", w0."account_uuid", w0."inserted_at", w0."updated_at", w0."user_uuid" FROM "wallet" AS w0 WHERE (w0."user_uuid" = $1) ORDER BY w0."user_uuid" [<<4, 237, 21, 88, 195, 170, 76, 214, 162, 219, 183, 55, 163, 61, 62, 112>>]
[debug] QUERY OK source="auth_token" db=0.6ms
SELECT a0."uuid", a0."id", a0."token", a0."owner_app", a0."user_uuid", a0."account_uuid", a0."expired", a0."expired_at", a0."inserted_at", a0."updated_at" FROM "auth_token" AS a0 INNER JOIN "user" AS u1 ON u1."uuid" = a0."user_uuid" WHERE ((u1."id" = $1) AND (a0."owner_app" = $2)) ["usr_01d744xjt6bzv8bmwkb00t5gh0", "admin_api"]
[debug] QUERY OK source="user" db=0.3ms
SELECT u0."uuid", u0."id", u0."is_admin", u0."global_role", u0."username", u0."full_name", u0."calling_name", u0."email", u0."password_hash", u0."provider_user_id", u0."metadata", u0."encrypted_metadata", u0."avatar", u0."enabled", u0."enabled_2fa_at", u0."backup_codes_created_at", u0."secret_2fa_code", u0."invite_uuid", u0."inserted_at", u0."updated_at", u0."uuid" FROM "user" AS u0 WHERE (u0."uuid" = $1) [<<4, 237, 21, 88, 195, 170, 76, 214, 162, 219, 183, 55, 163, 61, 62, 112>>]
[debug] Processing with AdminAPI.V1.TransactionController.all/2
  Parameters: %{"match_all" => [%{"comparator" => "contains", "field" => "from_wallet.address", "value" => "rdwk555993751080"}], "match_any" => [%{"comparator" => "eq", "field" => "from_account.id", "value" => "acc_01d744xjbq2b77jq2wb20qt8e5"}, %{"comparator" => "eq", "field" => "to_account.id", "value" => "acc_01d744xjbq2b77jq2wb20qt8e5"}], "per_page" => 8, "sort_by" => "created_at", "sort_dir" => "desc"}
  Pipelines: [:api, :admin_api]
[info] Sent 500 in 231ms
[error] #PID<0.3568.0> running UrlDispatcher.Plug (cowboy_protocol) terminated
Server: localhost:4000 (http)
Request: POST /api/admin/transaction.all
** (exit) an exception was raised:
    ** (Ecto.QueryError) apps/ewallet/lib/ewallet/web/filters/match_any_query.ex:97: field `id` in `where` does not exist in schema EWalletDB.Wallet in query:

from t0 in subquery(from t0 in EWalletDB.Transaction,
  select: %EWalletDB.Transaction{uuid: t0.uuid, id: t0.id, idempotency_token: t0.idempotency_token, from_amount: t0.from_amount, to_amount: t0.to_amount, status: t0.status, type: t0.type, payload: t0.payload, local_ledger_uuid: t0.local_ledger_uuid, error_code: t0.error_code, error_description: t0.error_description, error_data: t0.error_data, rate: t0.rate, calculated_at: t0.calculated_at, metadata: t0.metadata, encrypted_metadata: t0.encrypted_metadata, from_token_uuid: t0.from_token_uuid, to_token_uuid: t0.to_token_uuid, exchange_pair_uuid: t0.exchange_pair_uuid, to: t0.to, from: t0.from, from_account_uuid: t0.from_account_uuid, to_account_uuid: t0.to_account_uuid, from_user_uuid: t0.from_user_uuid, to_user_uuid: t0.to_user_uuid, exchange_account_uuid: t0.exchange_account_uuid, exchange_wallet_address: t0.exchange_wallet_address, inserted_at: t0.inserted_at, updated_at: t0.updated_at}),
  left_join: w1 in EWalletDB.Wallet,
  on: w1.address == t0.from,
  left_join: a2 in EWalletDB.Account,
  on: a2.uuid == t0.to_account_uuid,
  left_join: a3 in EWalletDB.Account,
  on: a3.uuid == t0.from_account_uuid,
  where: ilike(w1.address, ^"%rdwk555993751080%") and ^true,
  where: a2.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5" or (w1.id == ^"acc_01d744xjbq2b77jq2wb20qt8e5" or ^false),
  order_by: [desc: t0.inserted_at],
  limit: ^9,
  offset: ^0,
  distinct: true,
  select: t0,
  preload: [[:from_token, :from_wallet, :from_account, :from_user, :to_token, :to_wallet, :to_account, :to_user, :exchange_account, {:exchange_wallet, [:account]}, {:exchange_pair, [:from_token, :to_token]}]]

        (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
        (elixir) lib/enum.ex:1431: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
        (elixir) lib/enum.ex:1431: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
        (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
        (ecto) lib/ecto/repo/queryable.ex:132: Ecto.Repo.Queryable.execute/4
        (ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3
        (ewallet) lib/ewallet/web/paginators/paginator.ex:164: EWallet.Web.Paginator.fetch/3
        (ewallet) lib/ewallet/web/paginators/page_paginator.ex:61: EWallet.Web.PagePaginator.paginate/3
        (admin_api) lib/admin_api/v1/controllers/transaction_controller.ex:173: AdminAPI.V1.TransactionController.query_records_and_respond/3
        (admin_api) lib/admin_api/v1/controllers/transaction_controller.ex:15: AdminAPI.V1.TransactionController.action/2

Expected behavior
The request should be successful with the filter params applied.

Reproducible:

test build_query/3 with multiple match parsers supports nested fields (EWallet.Web.MatchParserTest)
test/ewallet/web/filters/match_parser_test.exs:270
** (Ecto.QueryError) lib/ewallet/web/filters/match_any_query.ex:97: field id in where does not exist in schema EWalletDB.Wallet in query:
from t0 in EWalletDB.Transaction,
left_join: w1 in EWalletDB.Wallet,
on: w1.address == t0.from,
left_join: a2 in EWalletDB.Account,
on: a2.uuid == t0.from_account_uuid,
where: ilike(w1.address, ^"%hnwr455624263981%") and ^true,
where: w1.id == ^"acc_01deep5z9nez11xv4j7zj0vcfy" or ^false,
distinct: true,
select: t0
code: |> Repo.all()
stacktrace:
(elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:1431: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1431: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/repo/queryable.ex:132: Ecto.Repo.Queryable.execute/4
(ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3
test/ewallet/web/filters/match_parser_test.exs:303: (test)


Скласти додаткові інформаційні блоки

Можна зробити резюме менш формальним, додавши додаткові блоки, які містять корисну інформацію, але подають її в "розважальній" формі. Наприклад, що подобається і не подобається, сильні і слабкі сторони, перелік навиків чи хобі, інфографіка або ж інтерактивні модулі, тощо. Варто написати контент такого блоку раніше, ніж починати верстку, бо його розміри впливатимуть на розміщення елементів на сторінці.

In a landmark election result, Republican Party nominee Donald Trump swept the highest votes to be elected the 45th President of the United States.
Having won key battleground states of Florida, Ohio and North Carolina, Trump has beaten Democratic Party candidate Hillary Clinton, who was backed by incumbent President Barack Obama, in one of the most exciting elections in the United States.
Here are the top 8 qualities that make Donald Trump a great leader.
Confidence
Love him or hate him but you can’t ignore him. Donald Trump’s confidence in what he believes in makes him a perfect leader.
Even after being saddled by allegations ranging from mafia ties to unscrupulous business dealings to racial discrimination in the last four decades, Trump has confidently steered towards a landslide victory in the Presidential Elections.
Authoratitive
Trump’s authority over his subject matter is one of the qualities one must possess as a leader.
Donald Trump made it evidently clear in the run up to the elections that his foreign policy will be singularly focused on Making America Safe Again by destroying radical Islamic terrorist groups, end the nuclear deal with Iran and the ransom payments to the world’s number one state sponsor of terrorism.
He said he will end the practice of apologizing to US’ enemies and will only stand by the country’s allies. This shows authority and makes him a great leader.
Dauntless
Donald Trump has been dauntless in his criticism of what he believes in.
Earlier in the year, Trump said no one will be tougher on the Islamic State than himself if elected. According to Trump, Islamic terrorism is eating up large portions of the Middle East and that is something we would aim to completely destroy.
Deal-maker
Trump is a great negotiator and is known to understand complex deals coupled with his knowledge of a wide variety of industries and businesses.
Trump has as yet bought properties that have less of an upside. Taking risks is part of business, but Trump has been clever in ensuring the risks are calculated.
In his election campaign, he promised to cut business rate to 15 percent, reduce individual rates to three brackets of 12, 25, and 33 percent, with a 0 percent rate for many. Keeping his great deal-making abilities in mind, he may be able to bring this to life.
Prudent With Resources
Instead of hiring new people to work in government offices, Trump is proposing that nobody is able to get a job in the federal workforce for at least the next four years.
This may mean government offices that spend half their time rubber stamping offices won’t be getting any new members of staff any time soon.
One of Trump’s newest policies is to ban foreign lobbyists from fundraising for United States governments, meaning that it will be only American people and companies who will be able to have a major influence on the result of an election.
Self-interest First
Trump has been clear in his election manifesto that he intends to bring the immigration system to prioritize the interests of Americans first. Trump has proposed enforcing immigration laws – at the border and at the workplace.
He has called for building a border wall and, ending sanctuary cities, sending criminal aliens home and welcoming the immigrants who embrace the American way of life.
Clear Priorities
Trump has time and again spoken of the federal government’s duty to protect the rights of its citizens.
According to Trump, the federal government should not diminish this right by denying its’ protection.
“I am opposed to abortion except for rape, incest and life of the mother. I oppose the use of government funds to pay for abortions,” Trump has said during his election campaign.
He has also extended unwavering support to the Second Amendment right to keep and bear arms.
He has called for getting serious about prosecuting violent criminals, empowering law-abiding gun owners to defend themselves and expanding mental health programs.
This shows he has clear priorities and does not mince his words.
Financial Understanding
Trump has a successful empire behind him, which he has led since taking over his father’s Fred Trump's real estate and construction firm, which was later renamed as The Trump Organization.
He has also been a television producer and having owned Miss USA pageants for nearly 10 years, he owns how finances must be managed.
With the trillions of dollars in debt, this is the sort of leader that might be able to turn it around for the US.


Shadows, filters plans

Hi!
First of all I would like to say "Thank you" for an amazing library! It's very helpful in RN projects.
Do you have any plans to implement the SVG elements filter or feGaussianBlur ?
They will be very helpful, especially for creating the shadows for shapes.

Any updates about this?

@webschik did you manage to find a solution regarding this either beit a native one?

@jakelacey2012, unfortunately not

Thank you very much for this great library! Are there any updates on this?

Is it possible programmatically? Personally I haven o clue.

I think the main difficulty is because of SVG API, for example (this is taken from w3schools lol):
<svg height="120" width="120">
  <defs>
    <filter id="f1" x="0" y="0" width="200%" height="200%">
      <feOffset result="offOut" in="SourceGraphic" dx="20" dy="20" />
      <feBlend in="SourceGraphic" in2="offOut" mode="normal" />
    </filter>
  </defs>
  <rect width="90" height="90" stroke="green" stroke-width="3"
  fill="yellow" filter="url(#f1)" />
</svg>

Will produce the following:

feOffset creates a copy of an input image in this case, then to create a shadow effect you need to apply different Blending Mode and Gaussian blur.
<filter id="f2" x="0" y="0" width="200%" height="200%">
      <feOffset result="offOut" in="SourceGraphic" dx="20" dy="20" />
      <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10" />
      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
 </filter>

And it will produce:

Not only the code for feOffset needs to be written, which will copy an image, but also different blending modes and Gaussian Blur.

If someone is interested in working on this, they can probably get some inspiration from how the mask element was implemented recently:
https://github.com/react-native-community/react-native-svg/commit/46307ecd2d2eb6849c0cb2465106201cb9901dda
https://github.com/react-native-community/react-native-svg/commit/b88cba85a41ee5af58e248674dfba3343430a014
In order to compute the mask for blending the images, it implements and uses the luminanceToAlpha type of feColorMatrix filter:
https://www.w3.org/TR/filter-effects/#element-attrdef-fecolormatrix-type
<filter id="luminanceToAlpha" filterUnits="objectBoundingBox">
<feColorMatrix id="luminance-value" type="luminanceToAlpha" in="SourceGraphic"/>
</filter>

ios:
https://github.com/react-native-community/react-native-svg/blob/b88cba85a41ee5af58e248674dfba3343430a014/ios/RNSVGRenderable.m#L215-L228
android:
https://github.com/react-native-community/react-native-svg/blob/46307ecd2d2eb6849c0cb2465106201cb9901dda/android/src/main/java/com/horcrux/svg/RenderableShadowNode.java#L269-L286
It would probably make sense to look into doing the filters on the gpu, but a plain cpu implementation just to get some support for it might already prove useful to some use cases.

Essentially it entails adding some logic where it now renders to the current context; to instead check if the current element has the filter attribute set, if so: create a map initialised to have the SourceGraphic bitmap, then compute the output of each filter primitive in the referenced filter element in order and store the outputs in the map with the ids as the keys. Then rendering the final output instead. Blending is also demonstrated by the mask logic.

@glthomas Great to hear :) The react part of it is relatively small, most of the work will probably be around implementing the bitmap filters on android and ios. Could possibly use GPUImage or GPUImage2 or plain core image on ios, and one of the gpuimage ports or renderscript on android. Alternatively, plain cpu based implementations in java and obj-c might be good enough for most static use cases, and at least simpler to get the build environment set up. Or how experienced are you in c++?

Actually, if you only need blur, then at least on android it's possible to implement it using https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur
and on iOS https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIGaussianBlur
In this case, quite a bit of the work is actually just with the setting up the new elements, the filter attribute, and then possibly a comparable amount of work for setting the source graphic, processing the blur, and merging the bitmaps, but all of it should be doable without adding any dependencies and all quite similar to the work with implementing the mask element and attribute.
Quite a few other filters (e.g. the luminanceToAlpha filter) can be implemented using https://developer.android.com/reference/android/graphics/ColorMatrixColorFilter and https://developer.android.com/reference/android/graphics/LightingColorFilter
and https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIColorMatrix etc.

It seems renderscript will almost certainly be the fastest implementation available on android:
https://stackoverflow.com/a/23119957/1925631
https://github.com/patrickfav/Dali/blob/master/dali/src/main/java/at/favre/lib/dali/blur/algorithms/RenderScriptGaussianBlur.java
https://android-developers.googleblog.com/2013/08/renderscript-intrinsics.html
And the implementation seems quite straightforward, along the lines of:
RenderScript rs = RenderScript.create(theActivity);
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(mRS, Element.U8_4(rs));;
Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
theIntrinsic.setRadius(25.f);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);

Can probably get some inspiration for optimisations from here: https://github.com/react-native-community/react-native-blur/blob/master/android/src/main/java/com/cmcewen/blurview/BlurringView.java

So, now the boilerplate for the elements and filter attribute would be needed, and of course, the main work of making the filter element create a rendering pipeline according to the svg compositing model: render > filter > clip > mask > opacity, so filters need to happen before the current clipping logic.
https://www.w3.org/TR/SVG11/render.html#Introduction
https://www.w3.org/TR/SVG11/filters.html
https://www.w3.org/TR/SVG2/render.html#FilteringPaintRegions
https://www.w3.org/TR/filter-effects-1/
If the value of the filter property is none then there is no filter effect applied. Otherwise, the list of functions are applied in the order provided.
<filter-function-list> = [ <filter-function> | <url> ]+
<filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()>
| <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <sepia()> | <saturate()>

The first filter function or filter reference in the list takes the element (SourceGraphic) as the input image. Subsequent operations take the output from the previous filter function or filter reference as the input image. filter element reference functions can specify an alternate input, but still uses the previous output as its SourceGraphic.
Filter functions must operate in the sRGB color space.
A computed value of other than none results in the creation of a stacking context [CSS21] the same way that CSS opacity does. All the elements descendants are rendered together as a group with the filter effect applied to the group as a whole.
The filter property has no effect on the geometry of the target element’s CSS boxes, even though filter can cause painting outside of an element’s border box.
Conceptually, any parts of the drawing are effected by filter operations. This includes any content, background, borders, text decoration, outline and visible scrolling mechanism of the element to which the filter is applied, and those of its descendants. The filter operations are applied in the element’s user coordinate system.
The compositing model follows the SVG compositing model [SVG11]: first any filter effect is applied, then any clipping, masking and opacity. As per SVG, the application of filter has no effect on hit-testing.

@msand, I’m doing my best to follow along.  I’ve got a lot of catch up to do, but I am going through the things you are writing here.  I also started looking at the “how to” build a react native bridge.

@glthomas Does this help? How much experience do you have with java and objective-c? What parts would you be interested in working on? Perhaps I can give some more specific advice how to get some first steps going.
E.g. at first, just to get a bit familiar with the code, I would suggest just applying the filter on all the rendered content, either in android or ios, whichever you're more familiar/comfortable with. Or, if you prefer to stick to the javascript part, then perhaps creating the various elements would be a good first step. What do you think?

Oh, my cache updated once I sent the message, didn't see your reply before sending.

Latest draft of the Filter Effects Module https://drafts.fxtf.org/filter-effects/
Inspiration for filter graph building: https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/core/paint/filter_effect_builder.cc

And webkit:
https://github.com/WebKit/webkit/blob/master/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/svg/SVGFilterElement.cpp

Needed interfaces for the elements and the bridge: https://drafts.fxtf.org/filter-effects/#idl-index
interface mixin SVGURIReference {
  [SameObject] readonly attribute SVGAnimatedString href;
};

interface SVGFilterElement : SVGElement {
  readonly attribute SVGAnimatedEnumeration filterUnits;
  readonly attribute SVGAnimatedEnumeration primitiveUnits;
  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
  readonly attribute SVGAnimatedLength width;
  readonly attribute SVGAnimatedLength height;
};

SVGFilterElement includes SVGURIReference;

interface mixin SVGFilterPrimitiveStandardAttributes {
  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
  readonly attribute SVGAnimatedLength width;
  readonly attribute SVGAnimatedLength height;
  readonly attribute SVGAnimatedString result;
};

interface SVGFEGaussianBlurElement : SVGElement {

  // Edge Mode Values
  const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
  const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
  const unsigned short SVG_EDGEMODE_WRAP = 2;
  const unsigned short SVG_EDGEMODE_NONE = 3;

  readonly attribute SVGAnimatedString in1;
  readonly attribute SVGAnimatedNumber stdDeviationX;
  readonly attribute SVGAnimatedNumber stdDeviationY;
  readonly attribute SVGAnimatedEnumeration edgeMode;

  void setStdDeviation(float stdDeviationX, float stdDeviationY);
};

SVGFEGaussianBlurElement includes SVGFilterPrimitiveStandardAttributes;

interface SVGFEMergeElement : SVGElement {
};

SVGFEMergeElement includes SVGFilterPrimitiveStandardAttributes;

interface SVGFEMergeNodeElement : SVGElement {
  readonly attribute SVGAnimatedString in1;
};

Its in my fork here: https://github.com/msand/react-native-svg/tree/filters?files=1
You can just modify the code while it's in node_modules and rebuild the native side.
Alternatively you can use npm link.

@msand I've cloned your filters branch and committed the interface for the RNSVGFilter.h for ios.  However, I am unable to push up to your forked repo.  What's the preferred process for contributing.  Is it better if I fork your fork and then I submit a pull request at some point down the line when I have a few more files to contribute?

@glthomas Great! It might make sense to rebase onto master of the main repo as well. Actually, fork this repo and make a PR here instead. I only use that one for private testing and preparing my own PRs.

@msand can you create a branch off of the master repo called "filter-support".  I only ask because I think the filter work might last for a bit and so a dedicated branch to serve as my target for my pull requests will prevent the partially completed work from getting to master prematurely.   I anticipate multiple pull requests on this filters work.  The added benefit is the multiple PR's can serve the purpose of code reviews as this will be very much a learning process especially as it pertains to the Objective-C, which is entirely new to me.
I think once we are satisfied that we have solid functionality on the filter-support branch and it's well tested, we can then merge this up to master.
Does this sound like a good plan?

@glthomas Sounds good. I rebased onto master here and pushed to the filters-branch, lets use this one going forwards. Please feel free to ask anything if there's something I might be able to help explain. I've learned obj-c by maintaining this project, didn't have any previous experience with anything apple/mac/ios/obj-c related before that (summer last year). So I have a relatively fresh learning experience of that as well and can probably save you some time.

@msand, so I’ve been studying the existing elements as well as your previous comments and trying to determine the next steps beyond adding the interfaces.  My focus initially will be on iOS.  Referring back to your comment from 19 days ago you mentioned “main work of making the filter element create a rendering pipeline according to the svg compositing model”.   As best as I can tell this means modifying the RNSVGRenerable.m file to include the code needed to handle the filtering (Possibly within the renderTo method and very near the if(self.mask) conditional.  Beyond that I’m a bit lost how to proceed with regards to utilizing the the feMergeNode(s).  Not too worried about learning objective-c.  It’s starting to make sense after staring at it for a while.

@glthomas Excellent, seem you're on the right track.
It would probably make sense to refactor the masking logic a bit.
First extract a method to render a node to a CIImage: (The first part inside if (self.mask) {}, currently it uses bitmaps, but we need to use CIImage instead to get efficient filters on iOS, as in the blur example earlier: https://github.com/react-native-community/react-native-svg/issues/150#issuecomment-427582490))
https://github.com/react-native-community/react-native-svg/blob/1f748205014a52029577dab4de4ce9e320ae2f54/ios/RNSVGRenderable.m#L178-L208
I think we should extract the luminanceToAlpha from the masking logic into a primitive and rewrite it to use CIImage instead of plain bitmaps: https://github.com/react-native-community/react-native-svg/blob/1f748205014a52029577dab4de4ce9e320ae2f54/ios/RNSVGRenderable.m#L210-L229
Then we would just apply the single luminanceToAlpha primitive in the masking logic.
https://gitlab.apertis.org/hmi/webkit-gtk-clutter/blob/06354006dce4769312ab6f863835a48d0433969e/WebCore/kcanvas/device/quartz/KCanvasMaskerQuartz.mm#L41-54
static CIImage *applyLuminanceToAlphaFilter(CIImage *inputImage)
{
    CIFilter *luminanceToAlpha = [CIFilter filterWithName:@"CIColorMatrix"];
    [luminanceToAlpha setDefaults];
    CGFloat alpha[4] = {0.2125, 0.7154, 0.0721, 0};
    CGFloat zero[4] = {0, 0, 0, 0};
    [luminanceToAlpha setValue:inputImage forKey:@"inputImage"];
    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputRVector"];
    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputGVector"];
    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBVector"];
    [luminanceToAlpha setValue:[CIVector vectorWithValues:alpha count:4] forKey:@"inputAVector"];
    [luminanceToAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBiasVector"];
    return [luminanceToAlpha valueForKey:@"outputImage"];
}

So, another method to apply a filter primitive to a CIImage, (and/or to bitmap as now, if you don't want to rewrite the luminanceToFilter primitive used in the masking logic). This could probably be defined in a common class which all filter primitives would inherit from, something like RNSVGFilterPrimitive.
Then we should add a method on the RNSVGSvgView, similar to [self.svgView getDefinedMask:self.mask] but getDefinedFilter:self.filter instead
And then a method on RNSVGFilter, to process a CIImage in a pipeline of filter primitives. (any pre-proccesing for this can be done in parseReference, and to define the filter in the svg root view)
Once we have at least a single filter primitive, and the rendering into a CIImage, we can change the logic in renderTo such that only if neither self.filter nor self.mask is set, does it use the last branch of the current code, otherwise, it should use the general pipeline, where it makes a CIImage of the render tree (using self instead of RNSVGMask *_maskNode in the [_maskNode renderLayerTo:bcontext rect:rect];, runs the filters on it if needed, does the masking if needed, and renders the result to the current CGContext.

For the feMergeNodes, we should have the parseReference method of the RNSVGFilter to set up a filter graph (map from index/name to filter instance, and the outputs of instances are set as inputs to any others which reference them), such that after setting the source graphic on the first filter primitive and we call createCGImage on the CIImage of the output node, the CIFIlter pipeline handles computing all the needed filters, where the merge nodes do something like this:
CIFilter *filter = [CIFilter filterWithName:@"CISourceOverCompositing"];
[filter setValue:background forKey:kCIInputBackgroundImageKey];
[filter setValue:foreground forKey:kCIInputImageKey];
CIImage *outputImage = [filter outputImage];

Or, simply:
https://developer.apple.com/documentation/coreimage/ciimage/1437837-imagebycompositingoverimage?l_2
[foreground imageByCompositingOverImage:background]

If I've understood/remember correctly then if we keep it as CIFIlter and CIImage until the actual rendering (createCGImage), it shouldn't process redundant filters in the graph. (i.e., ones which aren't connected to the output node) And it should create less intermediate processing/memory management pressure.

@msand, to do the refactoring you've suggested, do we need to import CoreImage in order to start using CIImage.
#import <CoreImage/CoreImage.h>
If so what file should we be importing this too?  RNSVGRenderable.m?
You mentioned also the need to refactor the mask code to use CIImage to make things efficient.  How do you mean?  Is the processing diverted to the GPU by using CIImage as opposed to CPU processing?
And for the record, I'm feeling really out of my league with this.  I'm starting to wonder if I can contribute in a more supplemental manner.  Perhaps building some tests, working on the documentation.  Etc.  I'm not trying to back out here, I'm just trying to be pragmatic.  I've got a limited amount of time I can contribute to this and I'm beginning to sense that it's going to take a lot of time and energy to get up to speed on this.  You seem to have a really solid understanding of what is happening with not only SVG but, the CoreGraphics and Image libraries.  It might take me 6 months to get up to where I need to be to have a solid enough understanding of what is happening with the pipeline to contribute in a way that doesn't require as much hand holding.  Please advise.

@glthomas Core Image can work on either the cpu or the gpu, in both cases it should be possible to get more efficient than the basic for loop + arithmetic, as it can utilize vector instructions, and do matrix operations very efficiently on the gpu. And in the case of filter chains, it sometimes has the potential to chain several filters together, such that it only needs to process each pixel once.
I've done an initial refactoring, and built out more of the boilerplate for the filters: https://github.com/react-native-community/react-native-svg/commit/b33f5575d86cc3d24257dbba4cc31597ac518212
Hopefully this can help you grok more of the logic and how to use CIImage/Filter. At least, applying a single filter on all of the content can be done in the same way as the masking is in the new logic. If you want I could probably build out the filter graph construction, and applying a filter chain if the filter attribute is set i.e., setting the source graphic / rendering the output; and implement e.g. the ColorMatrix filter as an example filter primitive. Then you could perhaps attempt to implement the blur, merge and mergeNode filter primitives?

@glthomas I think I have a rendering pipeline for filters which I'm sufficiently happy with for now at least, the applyFilter method is just the identity function for now, but once I have the filter graph constructed in parseReference, we can just set the inputImage and return the outputImage there.
static CGImageRef renderToImage(RNSVGRenderable *object,
                                CGSize bounds,
                                CGRect rect,
                                CGRect* clip)
{
    UIGraphicsBeginImageContextWithOptions(bounds, NO, 1.0);
    CGContextRef cgContext = UIGraphicsGetCurrentContext();
    CGContextTranslateCTM(cgContext, 0.0, bounds.height);
    CGContextScaleCTM(cgContext, 1.0, -1.0);
    if (clip) {
        CGContextClipToRect(cgContext, *clip);
    }
    [object renderLayerTo:cgContext rect:rect];
    CGImageRef contentImage = CGBitmapContextCreateImage(cgContext);
    UIGraphicsEndImageContext();
    return contentImage;
}

+ (CIContext *)sharedCIContext {
    static CIContext *sharedCIContext = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedCIContext = [[CIContext alloc] init];
    });

    return sharedCIContext;
}

- (void)renderTo:(CGContextRef)context rect:(CGRect)rect
{
    // This needs to be painted on a layer before being composited.
    CGContextSaveGState(context);
    CGContextConcatCTM(context, self.matrix);
    CGContextConcatCTM(context, self.transform);
    CGContextSetAlpha(context, self.opacity);

    [self beginTransparencyLayer:context];

    if (self.mask || self.filter) {
        CGRect bounds = CGContextGetClipBoundingBox(context);
        CGSize boundsSize = bounds.size;
        CGFloat width = boundsSize.width;
        CGFloat height = boundsSize.height;
        CGRect drawBounds = CGRectMake(0, 0, width, height);

        // Render content of current SVG Renderable to image
        CGImageRef currentContent = renderToImage(self, boundsSize, rect, nil);
        CIImage* contentSrcImage = [CIImage imageWithCGImage:currentContent];

        if (self.filter) {
            // https://www.w3.org/TR/SVG11/filters.html
            RNSVGFilter *_filterNode = (RNSVGFilter*)[self.svgView getDefinedFilter:self.filter];
            contentSrcImage = [_filterNode applyFilter:contentSrcImage];
        }

        if (self.mask) {
            // https://www.w3.org/TR/SVG11/masking.html#MaskElement
            RNSVGMask *_maskNode = (RNSVGMask*)[self.svgView getDefinedMask:self.mask];
            CGFloat x = [self relativeOn:[_maskNode x] relative:width];
            CGFloat y = [self relativeOn:[_maskNode y] relative:height];
            CGFloat w = [self relativeOn:[_maskNode width] relative:width];
            CGFloat h = [self relativeOn:[_maskNode height] relative:height];

            // Clip to mask bounds and render the mask
            CGRect maskBounds = CGRectMake(x, y, w, h);
            CGImageRef maskContent = renderToImage(_maskNode, boundsSize, rect, &maskBounds);
            CIImage* maskSrcImage = [CIImage imageWithCGImage:maskContent];

            // Apply luminanceToAlpha filter primitive
            // https://www.w3.org/TR/SVG11/filters.html#feColorMatrixElement
            CIImage *grayscaleMask = transformImageIntoGrayscaleMask(maskSrcImage);
            CIImage* composite = applyBlendWithAlphaMask(contentSrcImage, grayscaleMask);

            // Create masked image and release memory
            CGImageRef compositeImage = [[RNSVGRenderable sharedCIContext] createCGImage:composite fromRect:drawBounds];

            // Render composited result into current render context
            CGContextDrawImage(context, drawBounds, compositeImage);
            CGImageRelease(compositeImage);
            CGImageRelease(maskContent);
        } else {
            // Render filtered result into current render context
            CGImageRef filteredImage = [[RNSVGRenderable sharedCIContext] createCGImage:contentSrcImage fromRect:drawBounds];
            CGContextDrawImage(context, drawBounds, filteredImage);
            CGImageRelease(filteredImage);
        }

        CGImageRelease(currentContent);
    } else {
        [self renderLayerTo:context rect:rect];
    }
    [self endTransparencyLayer:context];

    CGContextRestoreGState(context);
}

@msand do we need to add the Core Image Framework to the project and import it?

@glthomas Sure, can do that. I have the ColorMatrix example from the spec mostly working now:
const ExampleFEColorMatrix = props => (
    <Svg viewBox="0 0 800 500" {...props}>
        <Defs>
            <LinearGradient
                id="a"
                gradientUnits="userSpaceOnUse"
                x1={100}
                y1={0}
                x2={500}
                y2={0}
            >
                <Stop offset={0.01} stopColor="#ff00ff" />
                <Stop offset={0.33} stopColor="#88ff88" />
                <Stop offset={0.67} stopColor="#2020ff" />
                <Stop offset={1} stopColor="#d00000" />
            </LinearGradient>
            <Filter
                id="b"
                filterUnits="objectBoundingBox"
                x="0%"
                y="0%"
                width="100%"
                height="100%"
            >
                <FEColorMatrix
                    in="SourceGraphic"
                    values=".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0"
                />
            </Filter>
            <Filter
                id="c"
                filterUnits="objectBoundingBox"
                x="0%"
                y="0%"
                width="100%"
                height="100%"
            >
                <FEColorMatrix
                    type="saturate"
                    in="SourceGraphic"
                    values={0.4}
                />
            </Filter>
            <Filter
                id="d"
                filterUnits="objectBoundingBox"
                x="0%"
                y="0%"
                width="100%"
                height="100%"
            >
                <FEColorMatrix
                    type="hueRotate"
                    in="SourceGraphic"
                    values={90}
                />
            </Filter>
            <Filter
                id="e"
                filterUnits="objectBoundingBox"
                x="0%"
                y="0%"
                width="100%"
                height="100%"
            >
                <FEColorMatrix
                    type="luminanceToAlpha"
                    in="SourceGraphic"
                    result="a"
                />
                <FEComposite in="SourceGraphic" in2="a" operator="in" />
            </Filter>
        </Defs>
        <Path fill="none" stroke="#00f" d="M1 1h798v498H1z" />
        <G fontFamily="Verdana" fontSize={75} fontWeight="bold" fill="url(#a)">
            <Path d="M100 0h500v20H100z" />
            <Text x={100} y={90}>
                Unfiltered
            </Text>
            <Text x={100} y={190} filter="url(#b)">
                Matrix
            </Text>
            <Text x={100} y={290} filter="url(#c)">
                Saturate
            </Text>
            <Text x={100} y={390} filter="url(#d)">
                HueRotate
            </Text>
            <Text x={100} y={490} filter="url(#e)">
                Luminance
            </Text>
        </G>
    </Svg>
);

And here's the mask example I've been testing:
const MaskExample = props => (
    <Svg width="100%" height="400" viewBox="0 0 800 300" {...props}>
        <Defs>
            <LinearGradient
                id="Gradient"
                gradientUnits="userSpaceOnUse"
                x1="0"
                y1="0"
                x2="800"
                y2="0"
            >
                <Stop offset="0" stopColor="white" stopOpacity="0" />
                <Stop offset="1" stopColor="white" stopOpacity="1" />
            </LinearGradient>
            <Rect
                id="Rect"
                x="0"
                y="0"
                width="800"
                height="300"
                fill="url(#Gradient)"
            />
            <Mask
                id="Mask"
                maskUnits="userSpaceOnUse"
                x="0"
                y="0"
                width="800"
                height="300"
            >
                <Rect
                    x="0"
                    y="0"
                    width="800"
                    height="300"
                    fill="url(#Gradient)"
                />
            </Mask>
            <Text
                id="Text"
                x="400"
                y="200"
                fontFamily="Verdana"
                fontSize="100"
                textAnchor="middle"
            >
                Masked text
            </Text>
        </Defs>
        <Rect x="0" y="0" width="800" height="300" fill="#FF8080" />
        <Use href="#Text" fill="blue" mask="url(#Mask)" />
        <Use href="#Text" fill="none" stroke="black" stroke-width="2" />
    </Svg>
);

More progress: Implement RNSVGFEGaussianBlur, RNSVGFEMerge & RNSVGFEMergeNode
https://github.com/react-native-community/react-native-svg/commit/21e3738f89f2ec7da5b4c0d6599f147e2b4a4d02

https://github.com/react-native-community/react-native-svg/commit/79748f9b20818e5b0edf1d42d011a91abe38ba20 [ios] Implement RNSVGFEBlend, RNSVGFEOffset, Fix RNSVGFEComposite

Added support for BackgroundImage and BackgroundAlpha, now it's already possible to do quite a lot with the existing primitives.

@glthomas Would be great with a bit more test cases at this point, to know what parts are still broken (of the parts that have implementations) in comparison to the ever-green browsers.

Dropshadows are possible to make now

const FilterExample = props => (
    <Svg width="100%" height="400" viewBox="0 0 200 120" {...props}>
        <Defs>
            <Filter
                id="a"
                filterUnits="userSpaceOnUse"
                x={0}
                y={0}
                width={200}
                height={120}
            >
                <FEGaussianBlur
                    in="SourceAlpha"
                    stdDeviation={4}
                    result="blur"
                />
                <FEOffset in="blur" dx={4} dy={4} result="offsetBlur" />
                <FEMerge>
                    <FEMergeNode in="offsetBlur" />
                    <FEMergeNode in="SourceGraphic" />
                </FEMerge>
            </Filter>
        </Defs>
        <Path fill="#888" stroke="#00f" d="M1 1h198v118H1z" />
        <G filter="url(#a)">
            <Path
                fill="none"
                stroke="#D90000"
                strokeWidth={10}
                d="M50 90C0 90 0 30 50 30h100c50 0 50 60 0 60z"
            />
            <Path
                fill="#D90000"
                d="M60 80c-30 0-30-40 0-40h80c30 0 30 40 0 40z"
            />
            <Text
                x={52}
                y={76}
                fill="#FFFFFF"
                stroke="#000000"
                fontSize={45}
                fontFamily="Verdana"
            >
                SVG
            </Text>
        </G>
    </Svg>
);

@msand, incredible work here.  Not sure how you find the time.  At any rate I tried adding the mask example you provided here to the Examples submodule maintained by @magicismight
I have a PR open over on there.  Though we still need to add an icon for the example.

I get the feeling that he's been very busy the past year or so, can't remember if he has written replied in any react-native-svg issues this year, or replied to any questions I've posed since I got rights to maintain the project. So I think he probably has too much other stuff going on to give much attention to these things.
Anyways, he did a great job getting most of svg working in react-native and am thankful for that. But we should probably move the example inside the repo and exclude it from npm, or, make a new one under react-native-community ( @dustinsavery do you have the rights for this? ). Or otherwise, I can make something under my own name and try to keep it up to date. And then it can be forked again once maintenance passes on to the ones who volunteer / are compensated to do the work. Could perhaps have a showcase part of the readme to nice examples / articles / tutorials etc to give more examples and boilerplate for people to get going more quickly.

@msand I do not have access. It looks as though @magicismight is the only contributor, meaning he's probably the only one that has access. Another person that might have any insight on how to proceed here is @brentvatne. Any thoughts?

@msand thank you for your work!
Do you have any estimate when filters branch will be merged in master?

Thanks! Well, should probably implement it for android as well before merging, otherwise there will be redundant questions. You can already use it for iOS by depending on a specific commit or this branch. Publishing to npm doesn't really change anything, as there's no compile step involved with publishing, it just copies a subset of the files to npm and tags it with a version number. Commits are at least referenced by a hash of the content and are in that sense actually safer.

I created a drop shadow plugin for React Native Android which creates a bitmap representation of the view and blurs it with a color and opacity. Feel free to use the code, maybe this can help you with the shadow / blur plugin. It works if I wraps the svg in the Androw component.
https://www.npmjs.com/package/react-native-androw
https://github.com/folofse/androw/tree/master/react-native-androw

@folofse Great work!
That can probably be used for relatively many cases as a workaround for now, by splitting svg content into background, blurred/shaded parts, and foreground.

@msand What's the update? How far along have you guys reached?

I have a pull request open to androw, with optimizations to make the drop shadows on android as efficient / simple as I could imagine and measure: https://github.com/folofse/androw/pull/1
With regards to filters in react-native-svg, the latest code is in the filters https://github.com/react-native-community/react-native-svg/tree/filters and hasn't been touched since 29 Oct 2018. All the latest updates are here in this issue, and most probably any development related to this will be mentioned here. So, all the updates are available here for you to read already.
iOS has a several filters with basic support at least: FEComposite, FEColorMatrix, FEGaussianBlur, FEMerge, FEBlend, FEOffset, FEPointLight, FESpecularLighting
Android has drop shadow support using the react-native-androw library, and blur using react-native-blur, color matrices using react-native-color-matrix-image-filters some others with react-native-image-filter-kit and react-native-gl-image-filters etc.
@theweavrs Could you work on it? Most of it can be done by porting what is implemented in objective-c for iOS to java for Android. The libraries mentioned here can be great for learning about how it can be implemented. Search engines and the built in "search in this repository" in github are great. Then it's mostly about adapting it to the rendering pipeline of the svg spec and react-native-svg. The refactoring process will be quite similar to the one on iOS, modulo system api differences. And I can probably assist in explaining things and guiding whenever requested. But, I'm not currently working on implementing it myself, and don't have it in my current plans, as I don't have a need for them at the moment.

Sorry - but we need this :)

@FDiskas Are you available to work on it?

Hello. I really appreciate all the hard work being done on react-native-svg and the filters branch, I really look forward to being able to use filters for drop shadows in a release some time soon. Thank you for the great work. 👍

@juliusbangert I relatively recently tried rebasing the filters branch onto the master branch, so you can try it by using e.g. the filters_rebase branch https://github.com/react-native-community/react-native-svg/tree/filters_rebase or the latest commit from there: https://github.com/react-native-community/react-native-svg/commit/257c7082c28ae5c8f7072f2be528ec7cb2ab8c01

@msand when will be available filters and new version of library?

I'm not currently working on it, and don't see myself having time to work on it in the near future. Would you be available to help build it?

I created a drop shadow plugin for React Native Android which creates a bitmap representation of the view and blurs it with a color and opacity. Feel free to use the code, maybe this can help you with the shadow / blur plugin. It works if I wraps the svg in the Androw component.
https://www.npmjs.com/package/react-native-androw
https://github.com/folofse/androw/tree/master/react-native-androw

Very interesting but doesn't seem to work if wrapped element position = "absolute". I tried to split svg contents creating a svg with the shaded parts and another svg with the other parts. When i try to overlay shadow layer with absolute positioning, the shadow is not rendered.

I'm implementing some svg filters for android, three for now: FeOffset, FeGaussianBlur and FeDropShadow. For the gaussian blur effect I used  the ScriptIntrinsicBlur, but it allows define only the blur radius while the svg filters (feegaussian and feedrop) use an attribute named "stdDeviation". I seached for the relation between blur radius and stdDeviation trying to find a way to convert one to another with no sucess. For this reason, the gaussian blur effect resulting of my implementation diverges from gaussian blur effects produced by browsers like firefox or Chrome. Could someone help me with that? The standard deviation implies that blurred image should be resized before apply blur?
Result of my implementation:

Result in Chrome:

Code (note de lack of feBlend in some filters, blend is hardcoded for now  ):

                <Filter id={"dropshadow"} x={"0%"} y={"0%"} width={"200%"} height={"200%"} filterUnits={"userSpaceOnUse"}>
                    <FeDropShadow stdDeviation={2} dx={2} dy={2} In={"SourceGraphic"} floodOpacity={0.6}/>
                </Filter>
                <Filter id={"dropshadow2"} x={"0%"} y={"0%"} width={"200%"} height={"200%"} filterUnits={"userSpaceOnUse"}>
                    <FeDropShadow stdDeviation={2} dx={5} dy={5} In={"SourceGraphic"} floodOpacity={0.6}/>
                </Filter>
                <Filter id={"quadrado"} x={"0%"} y={"0%"} width={"200%"} height={"200%"} filterUnits={"userSpaceOnUse"}>
                    <FeOffset result={"offOut"} In={"SourceGraphic"} dx={8} dy={8}/>
                    <FeGaussianBlur result={"blurOut"} In={"offOut"} stdDeviation={3}/>
                </Filter>
                <Filter id={"letra"} x={"0%"} y={"0%"} width={"120%"} height={"120%"} filterUnits={"objectBoundingBox"}>
                    <FeOffset result={"offOut"} In={"SourceAlpha"} dx={3} dy={3}/>
                    <FeGaussianBlur result={"blurOut"} stdDeviation={10} In={"offOut"}/>
                </Filter>

            </Defs>

<Rect x={150} filter={"url(#dropshadow2)"} width={"90"} height={"90"} stroke={"#2833d6"} strokeWidth={"3"} fill={"#dd3eda"} />
                <Path filter={"url(#dropshadow)"} stroke={"#58d64d"} strokeWidth={1} fill = {"#d6192b"} d={"M54.81,126.5h-5.02c-0.83,0-1.5-0.67-1.5-1.5v-19.27c0-0.83,0.67-1.5,1.5-1.5h5.02c0.83,0,1.5,0.67,1.5,1.5V125C56.31,125.83,55.64,126.5,54.81,126.5z"}/>

                <Path filter={"url(#letra)"} fill = {"#3130d6"} d={"M91.86,104.25c-0.28,0-6.33,0.02-6.5,0.03c-0.56,0.04-1.09,0.13-1.6,0.24c-0.16,0.04-0.33,0.08-0.49,0.13c0,0,0,0,0,0c-2.38,0.74-4.32,2.46-5.36,4.68c-1.91,3.44-1.8,8.69-0.05,12.16c1.41,2.97,4.44,5.03,7.95,5.03c0.52,0,5.57,0,5.98,0c3.44,0,6.41-1.97,7.86-4.84c2.28-4.29,1.76-9.1,0.07-12.62C98.26,106.21,95.29,104.25,91.86,104.25z M92.02,118.35c-0.61,0.85-1.61,1.4-2.74,1.4c-0.54,0-0.36,0-0.9,0c-1.12,0-2.11-0.54-2.72-1.38c-1.67-2.12-1.25-5.12,0.04-6.49c0.61-0.81,1.58-1.34,2.68-1.34c0.54,0,0.36,0,0.9,0c1.09,0,2.06,0.52,2.68,1.32C93.13,113.37,93.62,116.16,92.02,118.35z"}/>

            </G>

Down scaling images before blur applying and then up scaling to original size produced much better results. Now I'd like to understand more about reusing canvas and bitmaps instead of creating new instances of them. I have no experience with image processing.

@david-laurentino Excellent work! You might get some inspiration from here: https://github.com/folofse/androw/compare/50a4d75...msand:master
If you make your changes available on github, then I can read it through and see if I can find any potential optimizations.

Hi @msand any news regarding implementation of svg effects in your cool library?

Any updates on this? I'm using Expo and trying to implement a blur-radius shadow (like the shadowRadius iOS) on Android, but reading this thread now I know that filter, feGaussianBlur, feOffset are not implemented in react-native-svg yet. It's so sad because in iOS we already have shadowColor, shadowOffset, shadowOpacity, shadowRadius that allow us to implement shadows in View. But on Android we have nothing like it! We have just just a simple 'elevation' prop. I don't want to eject my project for this so react-native-svg was kinda of my hope. I think that just implementing filter, feGaussianBlur, feOffset would be enough for us to implement shadows on Android in a decent way.

I created a drop shadow plugin for React Native Android which creates a bitmap representation of the view and blurs it with a color and opacity. Feel free to use the code, maybe this can help you with the shadow / blur plugin. It works if I wraps the svg in the Androw component.
https://www.npmjs.com/package/react-native-androw
https://github.com/folofse/androw/tree/master/react-native-androw

Can I use it with Expo?

Ok, I found this package https://github.com/tokkozhin/react-native-neomorph-shadows that implements shadow radius on Android and it works beautifully! But unfortunately it's kinda slow (specially when navigating between screens). Is there a way to optimize this @msand?

@msand Hi, for my project quite important to have SVG filters, so I tried to implement the same logic for android which you implemented for ios. It's my first try for android and java. I made filters pipeline and one filter primitive(FEGaussianBlur), but I'm not sure in some places.
1 - Which for part of bitmap should be applied filter? (for bounds of target element or for full layer which contains this target)
2 - How does gaussian kernel calculate? Or kernel is a constant value
https://github.com/revich2/react-native-svg/commits/filters_android - this is my changes above your branch filters_rebase
Can you help me with it?

Excellent, awesome work @revich2
1 - Should probably use the current clip bounds, or the filter effects region: https://www.w3.org/TR/SVG11/filters.html#FilterEffectsRegion
2 -

The Gaussian blur kernel is an approximation of the normalized convolution:
G(x,y) = H(x)I(y)
where
H(x) = exp(-x2/ (2s2)) / sqrt(2* pi*s2)
and
I(y) = exp(-y2/ (2t2)) / sqrt(2* pi*t2)
with 's' being the standard deviation in the x direction and 't' being the standard deviation in the y direction, as specified by ‘stdDeviation’.
The value of ‘stdDeviation’ can be either one or two numbers. If two numbers are provided, the first number represents a standard deviation value along the x-axis of the current coordinate system and the second value represents a standard deviation in Y. If one number is provided, then that value is used for both X and Y.
Even if only one value is provided for ‘stdDeviation’, this can be implemented as a separable convolution.
For larger values of 's' (s >= 2.0), an approximation can be used: Three successive box-blurs build a piece-wise quadratic convolution kernel, which approximates the Gaussian kernel to within roughly 3%.
let d = floor(s * 3sqrt(2pi)/4 + 0.5)
... if d is odd, use three box-blurs of size 'd', centered on the output pixel.
... if d is even, two box-blurs of size 'd' (the first one centered on the pixel boundary between the output pixel and the one to the left, the second one centered on the pixel boundary between the output pixel and the one to the right) and one box blur of size 'd+1' centered on the output pixel.
Note: the approximation formula also applies correspondingly to 't'.
Frequently this operation will take place on alpha-only images, such as that produced by the built-in input, SourceAlpha. The implementation may notice this and optimize the single channel case. If the input has infinite extent and is constant (e.g FillPaint where the fill is a solid color), this operation has no effect. If the input has infinite extent and the filter result is the input to an ‘feTile’, the filter is evaluated with periodic boundary conditions.
‘feGaussianBlur’

https://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement

stdDeviation = ""
The standard deviation for the blur operation. If two s are provided, the first number represents a standard deviation value along the x-axis of the coordinate system established by attribute ‘primitiveUnits’ on the ‘filter’ element. The second value represents a standard deviation in Y. If one number is provided, then that value is used for both X and Y.
A negative value is an error (see Error processing). A value of zero disables the effect of the given filter primitive (i.e., the result is the filter input image). If ‘stdDeviation’ is 0 in only one of X or Y, then the effect is that the blur is only applied in the direction that has a non-zero value.
If the attribute is not specified, then the effect is as if a value of 0 were specified.
Animatable: yes.

https://www.w3.org/TR/SVG11/filters.html#feGaussianBlurStdDeviationAttribute
For sure, I can answer any questions, and perhaps help with some of the coding if I can make some spare time available.

Thank you for the given materials.
At the current moment, I moved on Android all components of filters, which was implemented for ios. Implemented Gaussian blur filter with third party library OpenCV.4.1.0.
But there are 2 problems, the first is big, the second is small.

Small problem - Algorithm for Gaussian blur, which is using in WebKit implementation has a bit different from that is provide OpenCV library.
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp - this is the link with the implementation of Gaussian blur from WebKit.
Big problem - OpenCV increases the application bundle on about 100+mb. This is a very powerful library, probably it is possible to do all of the effects of filters with its help, but bundle size is too big.
Probably, it is possible to take only the required module from OpenCV, but I first time in working with Android, thus I have only predictions, that this is possible.

From all this work and my researching I made several conclusions/questions:

Obviously, that required to choose an engine for image processing for Android.
(https://opencv.org/opencv-4-1/) OpenCV is an ideal variant for this goal. What do you think it is possible to take out from OpenCV only required part(Imgproc)?
I found more several probably useful libraries:

https://github.com/cats-oss/android-gpuimage - As I understand, this is a clon of CIImage for Android. But CIImage is restricting in implementation several filters(for example, for Gaussian blur at stdX != stdY).
https://github.com/wasabeef/glide-transformations - It simply has a lot of GitHub stars.

How do you think there is that ability to try to assemble filters native module from WebKit sources? This is would be very useful, for one this is possible to use for both platforms and for others this will be absolutely identical implementation.
https://github.com/WebKit/webkit/tree/master/Source/WebCore/platform/graphics/filters

What do you think about what can be done with all this?) @msand

@msand, can you help me with it? probably, steer me in the right direction

Sounds a bit large for sure, if that would be the approach taken, it would probably require making it an optional dependency / configurable, or if that's not possible, then as an additional module/package, either as submodule of some sort or monorepo here, or as an independent repo with links / instructions for use in this repo.
I suspect it might be worth to use whatever native apis are available on iOS to get good performance with reasonable amounts of code. But if the android implementation becomes harder than makes sense, or if there's a comparably performing c / c++ / cross-platform solution, then that is certainly a possible approach. That would probably require the NDK, which might upset some users as well, and then the optional submodule approach probably makes sense again. Ideally, there would be well performing solutions for both platforms in their respective native language (objective-c and java) to keep setup minimal, and perhaps also bundle size.
There's been loud complains about adding ~100kb to get support for essentially all of the css spec, cascade, specificity, priority, media queries etc. etc. https://github.com/react-native-community/react-native-svg/issues/1264
So, I fear some people might explode or go into rampage mode if there's an addition of even a single mb. Probably best to keep it at least somehow optional for the safety and health of everyone involved 😉
Webkit & other browser implementations might certainly be possible sources for reuse, they probably have done significant amount of performance optimisations as well. Wise to learn from their efforts.
In practise, don't worry about the implementation / approach or if it's optimal or not, as long as it works at all it's already great. And it is much easier to improve from there, once all the needed patterns / apis have been discovered and put together. It should be a community effort to find and fix any bleeding edges anyway. Ignore any potential trolls or unexperienced open source consumers / parasites that only complain and use negative language.

@msand I was back with new progress)) I choose the way with WebKit sources and NDK and I was able implement Gaussian blur. And I want to do it with other filters. I think it is the right way, one problem remains - it is work with threads in c++ for improving performance.
Can you help me with rebase your filters branch on the newest develop branch?
Can you check my changes for this and review the code?

@revich2 @msand Hello!
I'm here as a side watcher, wishing this filters branch to be merged eventually.
I think 100Mb dependency is just an enormous for almost any React Native application.
As I've understood @msand abandoned filter branch because started looking to new, more general, implementation (have seen in several comments) which utilizes new React Native archirecture and one unified C++ code for both Android and iOS.
I think it might make sense to go that way, as at time when this branch will be ready to merge, Fiber / Turbomodules should be released.
Anyway, thank you for your hard work! Truly appreciate that!

Keeping this alive, any status update about filters?
Are we working on it?

Keeping this alive, any status update about filters?
Are we working on it?

I think this branch is dead.
It's better to look at new approach using Turbomodules and cross-platform C++ implementation

Status?

Just convert it to PNG, and work from there. https://stackoverflow.com/questions/28444841/render-an-svg-with-filter-effects-to-png

svg should be done in open gl.
u can use gl-react.

Any updates or plans here?

I got trolled in TypeScript as feGaussianBlur is an intrinsic element, please add <3

Hey @msand is there an estimated eta on this feature?
I see that it is being worked on and need to make a product direction decision based on this so would be really helpful to have some sort of estimate. 👍👍
Thanks

I'm a maintainer of react-native-skia and it might be a better alternative for such effects. We support most of them (blur, noise, displacement maps etc).

you can display svg images: https://shopify.github.io/react-native-skia/docs/images-svg and even animated with a bit of imagination: https://twitter.com/wcandillon/status/1515731236861493258 Deeper SVG integrations will come in the future but right now this is not the most pressing issue on our side. Maybe it will be done by the community.
Meanwhile, SVG concepts can easily be mapped to our declarative Skia API, we will try to document the process a little bit more. But you can find a video that does a lot figma to skia convertions at https://www.youtube.com/watch?v=GFssmWUhwww

https://twitter.com/wcandillon/status/1515731236861493258

hi @wcandillon , Is this demo available in the react-native-skia project?

This is the SVG documentation: https://shopify.github.io/react-native-skia/docs/images-svg/
If you are looking for SVG filters, I recommend to use Skia directly, they map nicely from SVG: https://shopify.github.io/react-native-skia/docs/image-filters/overview

Waiting for working with svg shadows directly in react-native-svg library, any updates or plans about it from collaborators guys?

I just stumbled upon this issue. I'm sad this is currently not available, but I'm even more disappointed by the level of entitlement in this thread.
The work here is clearly not making progress, and keeping asking for timelines on it is not how open source works. If you have a business decision depending on a feature that is not available, you should probably dedicate time from your team to implement it, baking that in your estimates, and contributing to grow the project. That's how open source works.
If you or your team can't take the work, then the decision has likely been made: You can't use it. As an alternative look at the feasibility of what William has posted above, but please, don't keep calling it important and asking for status if there's clearly no progress happening, as it won't magically get the feature landed.
Sorry if this is rude and is just adding more noise here, but come on people... Grow up.

这是 SVG 文档：https://shopify.github.io/react-native-skia/docs/images-svg/ 如果您正在寻找 SVG 过滤器，我建议直接使用 Skia，它们很好地映射自 SVG：https //shopify.github.io/react-native-skia/docs/image-filters/overview

The upgrade costs are too high
it only support React Native 0.66.0
I really want to use it
it's a great library

这是来自QQ邮箱的假期自动回复邮件。 您好，我最近正在休假中，无法亲自回复您的邮件。我将在假期结束后，尽快给您回复。

I think that in SVG you can use a single filter:
<svg height="0" width="0">
  <filter id='shadow' color-interpolation-filters="sRGB">
    <feDropShadow dx="2" dy="2" stdDeviation="3" flood-opacity="0.5"/>
  </filter>
</svg>

Found in "Adding Shadows to SVG Icons With CSS and SVG Filters"

+1

这是来自QQ邮箱的假期自动回复邮件。 您好，我最近正在休假中，无法亲自回复您的邮件。我将在假期结束后，尽快给您回复。

+1

+1

+1

+1

2024 and this is still an issue, many of my recent projects i've been working on have been pretty ui heavy with shadows, blur, and animations, i've solved some of my issues except for lack of shadows in svg

We can use this repo https://github.com/SrBrahma/react-native-shadow-2


Message instance has no attribute 'body'

I'm trying to fetch the body of an email using
mails =<EMAIL_ADDRESS>mail = mails[0].fetch()
print mail['subject']
print mail.body

Here, I am able to get properties like subject, Received, etc. but when printing body, I get this error :

Message instance has no attribute 'body'

This is the data I'm getting :
From nobody Mon Dec 26 16:42:46 2016
Delivered-To<EMAIL_ADDRESS>Received: by <IP_ADDRESS> with SMTP id ferf98er9fef9fr;
.
.
.
X-Source-Dir: erferfefefrref:/public_html
X-CMAE-Envelope: grtgrtgrtgrtgrt......

This is the message body

@charlierguo please check this


Set the host ip address instead of localhost in kube config

It is a good practice to change the localhost Kubernetes API server in the ~/.kube/config to a host ip address or hostname, to avoid future problems.

It is not needed, due with that patch: https://github.com/openstack-k8s-operators/ansible-microshift-role/pull/67 we are making request not to the localhost, but to the fqdn, where the fqdn is set to the host ip address in the /etc/hosts.


Update portal links

Linked to https://github.com/osisoft/OSI-Samples/tree/derekendres-test

https://github.com/osisoft/OSI-Samples/pull/226

better now?


cannot match pattern

Nie można załadować modyfikacji "Warehousing": Mod Warehousing version {{VERSION}} not matching pattern "Major.Middle.Minor".

If you are trying to load the mod directly, that isn't supported. {{VERSION}} is a placeholder that gets filled in with the real version number during the build process; see Makefile.


Use nio file visitors in metacp.

Previously, metacp did a custom traversal of the classpath using a mix
of java.io and custom solutions via Fragment.  This commit adds
Classpath.visit which simplifies the implementations by using built-in
java.nio.Files.walkFileTree. This automatically fixes #1305.

Given that Travis is acting up, I'll be closing this pull request and incorporating it into mine (https://github.com/scalameta/scalameta/pull/1316). @olafurpg will need to sleep soon, and in my timezone it's still morning, so I'll have more time to fight with Travis.


fixing some links

There was an error while validating job 3576229e-c478-4262-8e15-e1ab38c99e83 Message:
Result status: Failed
There was a problem accessing Github repository 'https://github.com/Microsoft/cordova-docs.git'.
Details:Microsoft.LightweightJobEngine.Core.Language.ContextCommandBase+ContextCommandException:
Result status: Failed
There was a problem accessing Github repository 'https://github.com/Microsoft/cordova-docs.git'.
---> System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Error clonning repository ---> LibGit2Sharp.NotFoundException: Branch 265 not found. Available branches: origin/master
at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.GetBranch(Repository repo, String name)
at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.<>c__DisplayClass30.<>c__DisplayClass34.b__29(KeyValuePair2 branch)    at System.Collections.Generic.List1.ForEach(Action1 action)    at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.<>c__DisplayClass30.<CloneRepository>b__28()    at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()    at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func)
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy.ExecuteAction(Action action)
at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.CloneRepository(String url, IDictionary2 branches)    --- End of inner exception stack trace ---    at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.CloneRepository(String url, IDictionary2 branches)
at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.CloneRepository()
at Microsoft.DPS.Services.LibGit2SharpSourceControlProvider.GetVersionAsync(String path)
at Microsoft.DPS.Commands.IdentifyDocumentsToPublish.CheckExternalServicesCommand.Do(IDictionary2 context)    --- End of inner exception stack trace ---    --- End of inner exception stack trace ---    at Microsoft.LightweightJobEngine.Core.Language.ContextCommandBase.ThrowIfErrorsLogged()    at Microsoft.DPS.Commands.IdentifyDocumentsToPublish.CheckExternalServicesCommand.Do(IDictionary2 context)
at Microsoft.LightweightJobEngine.Core.Language.JobWorkflow1.RunCommands(Guid jobId, IDictionary2 context, CancellationTokenSource cancelSignal)


Make snippets.5000.json trigger the build

Parallel to https://github.com/dotnet/samples/pull/3746

It's not this simple, there are other code stuff that go into this in the tooling, we generally get together as a team on Wed. and work on improving the tools.
Thanks though. 😄


Handler not called if user presses systems "back" button when using SafariURLHandler.

Description:
When using SafariURLHandler, the user has the ability to hit the "back" button to return to the application which doesn't trigger the handler. I don't remember when this functionality was added to iOS. Could just affect iOS 10.

Having done some research the view controllers viewDidAppear doesn't get called after the application returns. So the only place that could handle it would be in the app delegate in this function below.
func applicationDidBecomeActive(_ application: UIApplication){  }
I checked documentation and the example and didn't see anything about what to put here to handle it.
The main problem here goes a bit beyond just the handler not getting called.
Lets say for a minute that you have a button on your application that creates a OAuth2Swift and then calls oauth.authorize(). If the user hits that system back button to return to your app the first handler isn't completed. Then if the user hits the authorize button again and completes the transaction both handlers will get a completion at once. This can stack indefinitely until the user completes the authorization. Which means if you are saving the result to a database in the "success" block, this may be called and executed multiple times. Even if you set the OAuth2Swift to a variable in order to remove the previous one, ALL success/fail closure will still get called.
I personally will be moving over to using an internal web view. However, I think something should be made to handle completion/fail in the event someone elses application is using the external Safari browser.
OAuth Provider (Twitter, Github, ..):
All
OAuth Version:

[x] Version 1
[x] Version 2

OS (Please fill the version) :

[x] iOS :
[ ] OSX :
[ ] TVOS :
[ ] WatchOS  :

Installation method:

[ ] Carthage
[ ] CocoaPods
[x] Manually

Library version:

[x] head
[ ] v1.0.0
[ ] v0.6
[ ] other: (Please fill in the version you are using.)

Xcode version:

[x] 8.0 (Swift 3.0)
[ ] 8.0 (Swift 2.3)
[ ] 7.3.1
[ ] other: (Please fill in the version you are using.)
[ ] objective c

How did you achieve to have a back button in status bar?
With iphone 7 plus simulator I have a Done button

When I click safariViewControllerDidFinishfunction is called in SafariURLHandler and remove all the observers, so no issue

I see I click on the button at the bottom

This occurs is when you use the external Safari Browser...as in iOS's safari app. In the demo select the option "Open with external web browser".
The issue is that currently there is no way to tell if the user hits this button. So you cant clear observers from anyway that I can tell. Guess one could create a singleton class that the app delegates applicationDidBecomeActive() function could call which would store the handler.  However, being that this is an option that the OAuthSwift framework provides, a more permanent solution is probably required.

So nothing about SafariUrlHandler

@phimage I know. Just thought Id make you guys aware of the issue since it is something that can be found as an option in the demo.

I did it this way because I have a million things to do and that was the fastest way to implement. Moving over to internal safariViewController as you suggested.

see readme
By default this URL is opened into the external web browser (ie. safari), but apple does not allow it for app-store iOS applications.

If you think readme it's not clear, you can propose PR


Load PDB from external URL without extension

Hi,
I need to load different assemblies from URLs like that:
https://files.rcsb.org/download/1QVT.pdb2.gz
But NGL returns the next error message:
1QVT:1 Uncaught (in promise) autoLoad: ext 'pdb2' unknown
It happens the same when I try lo load a PDB from external URL but without extension:
http://mmb.irbbarcelona.org/api/pdb/1qvt
The error in this case is:
1QVT:1 Uncaught (in promise) autoLoad: ext '' unknown
Is it possible to load these kind of files? And referring to the assemblies, if is not possible to load them separately, how can I load a specific assembly from a PDB file?
Thanks.

You might try to specify the file extension in the loadFile parameters. See documentation here : http://arose.github.io/ngl/api/Stage.html
stage.loadFile( 'https://files.rcsb.org/download/1QVT.pdb2.gz' , { ext: 'pdb' } )

Hi Paul, that was exactly what I needed.
Thanks a lot for your fast answer!

@gbayarri I believe NGL has native support for biological assemblies. You only need to load the standard mmcif/pdb/mmtf file and then choose the biological assembly you want. I couldn't find the docs to do it, but this is a good pointer: https://github.com/arose/ngl/issues/78

stage.loadFile( "data://3dqb.pdb", {
    assembly: "BU1"  // AU for asymmetric unit; BU1, BU2, ... for biological unit
} ).then( function( o ){
    o.addRepresentation( "cartoon" );
    o.autoView();
    return o;
} );


Pass ARCHITECTURE & OPERATING_SYSTEM env variables to remote rabbitmq install script

https://github.com/Shippable/pm/issues/10230

this is done, closing


Always sync objects to forest, even in namespaces with critical conditions

See #347. When an object is removed, we need to remove it from the
in-memory forest even when the object is in a namespace with a critical
condition, because when the condition is resolved, we'll use the forest
to re-sync all descendants of that namespace, and if the forest has
stale objects in it, the propagated copies won't be removed.
Added several other cleanups including:

Made several names more unique so they can be more easily searched
(e.g. replaced delete() with deleteObject())
Factored out a new syncMissingObject() functionout of Reconcile()
Some cosmetic renames plus a bunch of longer comments

TESTED: new integ test fails without the fix and works with it; also
tested manually on GKE.

Fixes #347

/assign @yiqigao217
/assign @rjbez17

/lgtm
/approve
/hold
@yiqigao217 feel free to remove hold when satisfied

/lgtm
/approve
/hold cancel


Redefines assert() to run outside of debug mode.

assert() is redefined as check() in liburing.h to ensure that it
will run if NDEBUG is defined. Without this, certain tests will
fail due to functions being called within an assert(), which are
skipped if NDEBUG is defined.
check() is a macro that will use assert() if NDEBUG is not defined.
Otherwise, it uses its own implementation.

Yeah good point, it's all from contributed cases, I generally dislike debug/assert statements with side effects. While this would work, I'd greatly prefer having them all changed to something ala:
ret = foo();
assert(foo != 0);
or whatever is appropriate for the given case. Any chance I can talk you into doing that change instead?

Thanks! Can you squash the two commits into one?

Thanks!


Fix set done bug and add Done List and Set Gui test cases

Coverage increased (+4.6%) to 88.777% when pulling 4e6575ee9db829751f2a0fcf56cc1208204220e3 on V0.5_Set_command_test_cases into d01b437d7fdefc39736ec4056f5c27a0fd482302 on V0.5_MainBranch.


Error loading stream

Hi, thanks for the plugin but I'm having issues loading Kick streams, plugin is installed into AppData\Roaming\streamlink\plugins, running Streamlink 5.3.1 and I've installed cloudscraper.
C:\Users\xxxx\Desktop>streamlink https://kick.com/xxxxxx best
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Program Files\Streamlink\bin\streamlink.exe_main.py", line 18, in
File "C:\Program Files\Streamlink\pkgs\streamlink_cli\main.py", line 881, in main
setup_plugins(args.plugin_dirs)
File "C:\Program Files\Streamlink\pkgs\streamlink_cli\main.py", line 697, in setup_plugins
load_plugins(PLUGIN_DIRS, showwarning=False)
File "C:\Program Files\Streamlink\pkgs\streamlink_cli\main.py", line 611, in load_plugins
success = streamlink.load_plugins(str(directory))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Streamlink\pkgs\streamlink\session.py", line 617, in load_plugins
mod = load_module(module_name, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Streamlink\pkgs\streamlink\utils\module.py", line 14, in load_module
spec.loader.exec_module(mod)
File "", line 936, in exec_module
File "", line 1074, in get_code
File "", line 1004, in source_to_code
File "", line 241, in _call_with_frames_removed
File "C:\Users\sodwy\AppData\Roaming\streamlink\plugins\kick.py", line 74
streamlink-plugin-kick/kick.py at master · nonvegan/streamlink-plugin-kick
^
SyntaxError: invalid character '·' (U+00B7)
Any ideas? Thanks!

Looks like you accidentally downloaded the html webpage instead of the actual plugin raw file. Can you check if that's the case?

I think I might have, I copied the raw file instead but still get an error.
C:\Users\sodwy\Desktop>streamlink https://kick.com/xxxx best
[session][error] Failed to load plugin kick from C:\Users\sodwy\AppData\Roaming\streamlink\plugins
Traceback (most recent call last):
File "C:\Program Files\Streamlink\pkgs\streamlink\session.py", line 617, in load_plugins
mod = load_module(module_name, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Streamlink\pkgs\streamlink\utils\module.py", line 14, in load_module
spec.loader.exec_module(mod)
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\sodwy\AppData\Roaming\streamlink\plugins\kick.py", line 8, in
import cloudscraper
ModuleNotFoundError: No module named 'cloudscraper'
error: No plugin can handle URL: https://kick.com/xxxx
cloudscraper is installed.

Hmnnn, that's the same issue as #2... Can you try python -m pip install cloudscraper and see if that fixes it?

Doesn't appear so. I removed cloudscraper and re-installed it, same error.

I think I might know why this is happening. So the streamlink windows builds come bundled with their own embedded Python environment, so this would explain why it's not finding the module installed via pip.

Ah, that was it! I copied cloudscraper and requests_toolbelt into C:\Program Files\Streamlink\pkgs and now it's all working. Thanks!

Sweet!


Extension(ssg) · ⚠    ReferenceError: window is not defined

Hi thx for this great plugin!  I have found the following issue. I am not sure where the problem lies. The SSG version seems to work just fine and I can serve it. But during generation I get this error:
✖ Extension(ssg) · Generating route... /
  › window is not defined
 Extension(ssg) · ⚠    ReferenceError: window is not defined

  - server-bundle.js:1 Module.4edf
    server-bundle.js:1:12697

  - server-bundle.js:1 o
    server-bundle.js:1:194

  - server-bundle.js:1 Object.0
    server-bundle.js:1:1475

  - server-bundle.js:1 o
    server-bundle.js:1:194

  - server-bundle.js:1 module.exports.0
    server-bundle.js:1:1436

  - server-bundle.js:1 Object.<anonymous>
    server-bundle.js:1:1445

  - build.prod.js:1 o
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:77517

  - build.prod.js:1
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:78110

  - new Promise

  - build.prod.js:1
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:78018

  - build.prod.js:1 Object.renderToString
    [comcharax-componardo]/[vue-server-renderer]/build.prod.js:1:81553

  - ssr-config.js:60 Object.module.exports.renderToString
    [comcharax-componardo]/[.cache]/quasar-app-extension-ssg/ssr-config.js:60:12

  - generator.js:111
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:111:16

  - new Promise

  - generator.js:105 Generator.render
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:105:12

  - generator.js:77 Generator.generate
    [comcharax-componardo]/[quasar-app-extension-ssg]/src/generate/generator.js:77:27

Done in 3.78s.

Any idea what this is about and where it comes from?

Hi,
It seems that the window object is called somewhere in your app. This object is not available at server side.
Be sure that you write universal code like you would do in SSR mode.
In most cases this is due to a third party library. If you are using some Boot files, you can specify to run it only at client side.


”Cuci”, ”Dătășeni”, ”După Deal”, ”Orosia”, ”Petrilaca” are listed in the drop-down menu

Description:
When user writes ”Cuci”, ”Dătășeni”, ”După Deal”, ”Orosia”, ”Petrilaca” the locations appear in the drop-down menu next to the comune and the county which is a part according to the law.
Precondition:
The website is up an running.

Step 1
Write in the search bar "Cuci"

Expected results
The location appears in the drop-down menu as "Sat Cuci, MUREȘ (Cuci)".

Step 2
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 3
Write in the search bar "Dătășeni"

Expected results
The location appears in the drop-down menu as "Sat Dătășeni, MUREȘ (Cuci)".

Step 4
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 5
Write in the search bar "După Deal"

Expected results
The location appears in the drop-down menu as "Sat După Deal, MUREȘ (Cuci)".

Step 6
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 7
Write in the search bar "Orosia"

Expected results
The location appears in the drop-down menu as "Sat Orosia, MUREȘ (Cuci)".

Step 8
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 9
Write in the search bar "Petrilaca"

Expected results
The location appears in the drop-down menu as "Sat Petrilaca, MUREȘ (Cuci)".


Generated PKGBUILD fails at "Applying domain substitution"

error.log

It seems like it fails on the sed command right after domain substitution, which is line 80 of PKGBUILD.ungoogin.
@xsmile Have the file paths changed, or should the line be removed?

This is fine, however sed and the following commands need to be run on the Chromium source. A cd "$_tree" is missing after the buildkit operations.

@xsmile I see, didn't realize it was in the wrong directory. Thanks.


Feature/dashboard styling

On the dashboard, style the search bar's search button to fit inside search bar.

Looks good


Fix: in some rare cases the tables in the information_schema

was not updated on every node after table schema changes

otherwise ack


new capacity has to be strictly positive with custom encoder for "piste" ways

Describe the bug
Europe graph is crashing with custom encoder. I tested it on single country (Poland) and it worked. Every time after 3 billion node I receive crash:
Could not parse OSM file: /var/cache/appdata/europe-latest.osm.pbf 	at com.graphhopper.reader.osm.WaySegmentParser.readOSM(WaySegmentParser.java:401) 	at com.graphhopper.reader.osm.WaySegmentParser.readOSM(WaySegmentParser.java:119) 	at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:160) 	at com.graphhopper.GraphHopper.importOSM(GraphHopper.java:695) 	at com.graphhopper.GraphHopper.process(GraphHopper.java:651) 	at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:615) 	at routeFinder.factory.GraphFactory.createGraphHopper(GraphFactory.kt:134) 	at routeFinder.factory.GraphFactory.access$createGraphHopper(GraphFactory.kt:27) 	at routeFinder.factory.GraphFactory$createGraph$2.invokeSuspend(GraphFactory.kt:69) 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) Caused by: java.lang.IllegalArgumentException: new capacity has to be strictly positive 	at com.graphhopper.storage.RAMDataAccess.ensureCapacity(RAMDataAccess.java:66) 	at com.graphhopper.reader.PillarInfo.ensureNode(PillarInfo.java:58) 	at com.graphhopper.reader.PillarInfo.setNode(PillarInfo.java:63) 	at com.graphhopper.reader.osm.OSMNodeData.addPillarNode(OSMNodeData.java:170) 	at com.graphhopper.reader.osm.OSMNodeData.addCoordinatesIfMapped(OSMNodeData.java:155) 	at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.handleNode(WaySegmentParser.java:221) 	at com.graphhopper.reader.osm.WaySegmentParser$ReaderElementHandler.handleElement(WaySegmentParser.java:517) 	at com.graphhopper.reader.osm.WaySegmentParser.readOSM(WaySegmentParser.java:396)
I tried to follow error stack and somehow "nextPillarId" seems to be negative:
 private int addPillarNode(long osmId, double lat, double lon, double ele) {
        pillarNodes.setNode(nextPillarId, lat, lon, ele);
        int id = pillarNodeToId(nextPillarId);
        idsByOsmNodeIds.put(osmId, id);
        nextPillarId++;
        return id;
    }

because then code execution goes to "setNode" and ensureNode:
  @Override
    public void setNode(int nodeId, double lat, double lon, double ele) {
        ensureNode(nodeId);
...

  @Override
    public void ensureNode(int nodeId) {
        long tmp = (long) nodeId * rowSizeInBytes;
        da.ensureCapacity(tmp + rowSizeInBytes);
    }

end code crashes in ensureCapacity:
 @Override
    public boolean ensureCapacity(long bytes) {
        if (bytes < 0)
            throw new IllegalArgumentException("new capacity has to be strictly positive");

If bytes are negative then nodeId had to be negative and somehow "nextPillarId" had to be negative as well. "nextPillarId" is integer so maybe there are too many pillars?
To Reproduce
Steps to reproduce the behavior. For examples:

use europe.pbf file from geofabric
add custom encoder:

class PisteEncoder : AbstractFlagEncoder(4, 1.0, 0) {

    companion object {
        val encoderName = "piste"
    }

    init {
        avgSpeedEnc = DecimalEncodedValueImpl(EncodingManager.getKey(name, "average_speed"), speedBits, speedFactor, false)
        restrictedValues.clear()
        blockFords(false)
    }

    override fun createEncodedValues(registerNewEncodedValue: MutableList<EncodedValue?>) {
        super.createEncodedValues(registerNewEncodedValue)
        registerNewEncodedValue.add(avgSpeedEnc)
    }

    override fun getTransportationMode(): TransportationMode = TransportationMode.FOOT

    override fun getAccess(way: ReaderWay): EncodingManager.Access {
        return EncodingManager.Access.WAY
    }

    override fun applyWayTags(way: ReaderWay?, edge: EdgeIteratorState?) {
    }

    override fun handleWayTags(edgeFlags: IntsRef, way: ReaderWay): IntsRef {
        if (way.isPisteNordic()) {
            avgSpeedEnc.setDecimal(false, edgeFlags, 5.0)
            accessEnc.setBool(false, edgeFlags, way.isPisteNordic())
            accessEnc.setBool(true, edgeFlags, way.isPisteNordic())
        }

        return edgeFlags
    }

    private fun ReaderWay.isPisteNordic(): Boolean {
        return getTag("piste:type") == "nordic"
    }

    override fun getName(): String {
        return encoderName
    }
}

Expected behavior
System Information
I tested it on our currently used version of Graphhopper which is 5.3. We have a lot of custom encoders, so it was hard to quickly update to latest version to test it. JDK 21

I am trying to rewrite project to 8.0 (btw are there any migration guides between major versions? I could not find any) but I'm pretty sure it will work there because 8.0 is using long.
I am also sure that it has to be integer overflow because there is no code that could change "nextPillarId" to negative. Last log with node count supports this:
Creating graph. Node count (pillar+tower):<PHONE_NUMBER>, totalMB:204800, usedMB:157422
Given max int as<PHONE_NUMBER> there had to be overflow in pillar or tower and logs shows that pillar is the one
This is Europe file with 7 encoders and elevation data.