Skip to content

Commit dd26aa1

Browse files
author
Amir Tocker
committed
Move AuthToken and TextLayer to the shared code + update layer encoding
Double encode %2C and %2F to %252C and %252F
1 parent bfaa11f commit dd26aa1

File tree

11 files changed

+182
-567
lines changed

11 files changed

+182
-567
lines changed

Cloudinary.NetCoreTest/ApiTest.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,14 @@ public void TestOverlayHelpers()
396396
layerTests.Add(new Layer().ResourceType("video").PublicId("cat"), "video:cat");
397397
layerTests.Add(new TextLayer().Text("Hello World, Nice to meet you?")
398398
.FontFamily("Arial")
399-
.FontSize(18), "text:Arial_18:Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F");
399+
.FontSize(18), "text:Arial_18:Hello%20World%252C%20Nice%20to%20meet%20you%3F");
400400
layerTests.Add(new TextLayer("Hello World, Nice to meet you?")
401401
.FontFamily("Arial")
402402
.FontSize(18)
403403
.FontWeight("bold")
404404
.FontStyle("italic")
405405
.LetterSpacing("4")
406-
.LineSpacing("3"), "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3:Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F");
406+
.LineSpacing("3"), "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3:Hello%20World%252C%20Nice%20to%20meet%20you%3F");
407407
layerTests.Add(new SubtitlesLayer().PublicId("sample_sub_en.srt"), "subtitles:sample_sub_en.srt");
408408
layerTests.Add(new SubtitlesLayer().PublicId("sample_sub_he.srt").FontFamily("Arial").FontSize(40), "subtitles:Arial_40:sample_sub_he.srt");
409409

@@ -415,6 +415,20 @@ public void TestOverlayHelpers()
415415
}
416416
}
417417

418+
[Test]
419+
public void TestMultipleLayers()
420+
{
421+
422+
Transformation t = new Transformation()
423+
.Overlay("One").Chain()
424+
.Overlay("Two").Chain()
425+
.Overlay("Three").Chain()
426+
.Overlay("One").Chain()
427+
.Overlay("Two").Chain();
428+
var actual = m_api.UrlImgUp.Transform(t).BuildUrl("sample.jpg");
429+
Assert.AreEqual(m_defaultImgUpPath + "l_One/l_Two/l_Three/l_One/l_Two/sample.jpg", actual);
430+
431+
}
418432
[Test]
419433
public void TestUnderlay()
420434
{

Cloudinary.Test/ApiTest.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,14 @@ public void TestOverlayHelpers()
395395
layerTests.Add(new Layer().ResourceType("video").PublicId("cat"), "video:cat");
396396
layerTests.Add(new TextLayer().Text("Hello World, Nice to meet you?")
397397
.FontFamily("Arial")
398-
.FontSize(18), "text:Arial_18:Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F");
398+
.FontSize(18), "text:Arial_18:Hello%20World%252C%20Nice%20to%20meet%20you%3F");
399399
layerTests.Add(new TextLayer("Hello World, Nice to meet you?")
400400
.FontFamily("Arial")
401401
.FontSize(18)
402402
.FontWeight("bold")
403403
.FontStyle("italic")
404404
.LetterSpacing("4")
405-
.LineSpacing("3"), "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3:Hello%20World%E2%80%9A%20Nice%20to%20meet%20you%3F");
405+
.LineSpacing("3"), "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3:Hello%20World%252C%20Nice%20to%20meet%20you%3F");
406406
layerTests.Add(new SubtitlesLayer().PublicId("sample_sub_en.srt"), "subtitles:sample_sub_en.srt");
407407
layerTests.Add(new SubtitlesLayer().PublicId("sample_sub_he.srt").FontFamily("Arial").FontSize(40), "subtitles:Arial_40:sample_sub_he.srt");
408408

@@ -414,6 +414,20 @@ public void TestOverlayHelpers()
414414
}
415415
}
416416

417+
[Test]
418+
public void TestMultipleLayers()
419+
{
420+
421+
Transformation t = new Transformation()
422+
.Overlay("One").Chain()
423+
.Overlay("Two").Chain()
424+
.Overlay("Three").Chain()
425+
.Overlay("One").Chain()
426+
.Overlay("Two").Chain();
427+
var actual = m_api.UrlImgUp.Transform(t).BuildUrl("sample.jpg");
428+
Assert.AreEqual(m_defaultImgUpPath + "l_One/l_Two/l_Three/l_One/l_Two/sample.jpg", actual);
429+
430+
}
417431
[Test]
418432
public void TestUnderlay()
419433
{

Cloudinary/AuthToken.cs

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)