Unione di funzione/decoder-hevc in funzione/senza-terzi (catena della 0.3.0)
Porta in senza-terzi tutta la catena: documenti ed esportazione, S4b, codec delle immagini, H.264 e HEVC. Conflitti risolti tenendo le due parti: CI e Dockerfile di senza-terzi (solo comandi, Febe processo 1, un carattere) senza ffmpeg, che il ramo dei video ha tolto; categoria «da fare» di riepilogo-prove.sh tenuta; decisioni.md con tutte le righe, prima quelle della catena e poi quelle di C6; CLAUDE.md con le righe della CI di C6 senza ffmpeg; prove della pipeline con tutti e due i controlli. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
e4dbc5ad68
919 files changed
+65484
-1299
No files matched your search
@@ -53,6 +53,15 @@ public sealed partial class TestSite
|
||||
/// <summary>The nonce of the page load (session:entry_nonce, header <c>x-fb-entry-nonce</c>; AvvioProva.nonce).</summary>
|
||||
public const string EntryNonce = "nonce-di-prova";
|
||||
|
||||
/// <summary>The revision of the page load (session:spin_r, field <c>__spin_r</c>; GiroProva.revisione, a number in the page).</summary>
|
||||
public const string SpinRevision = "1001";
|
||||
|
||||
/// <summary>The branch of the page load (session:spin_b, field <c>__spin_b</c>; GiroProva.ramo).</summary>
|
||||
public const string SpinBranch = "ramo-di-prova";
|
||||
|
||||
/// <summary>The time of the page load (session:spin_t, field <c>__spin_t</c>; GiroProva.tempo, a number in the page).</summary>
|
||||
public const string SpinTime = "1700000000";
|
||||
|
||||
/// <summary>A cookie of the pages limited to the addresses under <see cref="ApiPath"/> (Path=/api/): the copy keeps it with its path.</summary>
|
||||
public const string ApiPathCookie = "percorso_api";
|
||||
|
||||
@@ -258,7 +267,8 @@ public sealed partial class TestSite
|
||||
// The values of the page the saved session copies (S4): a missing or different one gets the same generic 400.
|
||||
if (form["__rev"].ToString() != Revision || form["__hs"].ToString() != HasteSession || form["__hsi"].ToString() != HasteSessionId
|
||||
|| form["__ccg"].ToString() != ConnectionClass || form["dpr"].ToString() != Dpr || form["__comet_req"].ToString() != CometReq
|
||||
|| request.Headers["x-fb-entry-nonce"].ToString() != EntryNonce)
|
||||
|| request.Headers["x-fb-entry-nonce"].ToString() != EntryNonce
|
||||
|| form["__spin_r"].ToString() != SpinRevision || form["__spin_b"].ToString() != SpinBranch || form["__spin_t"].ToString() != SpinTime)
|
||||
{
|
||||
return ("campi", null);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<!-- Sito locale per le prove senza Instagram (§14.2): pagine spoglie, nessun marchio, nessuna pagina di accesso.
|
||||
Dati sintetici generati da un seme, in un formato JSON nostro (LEGGIMI.md); immagini generate con SkiaSharp. -->
|
||||
Dati sintetici generati da un seme, in un formato JSON nostro (LEGGIMI.md); immagini disegnate e codificate con il
|
||||
codice di Febe (Febe.Core: Drawing e Codecs/Images), nessuna libreria di grafica. -->
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyName>febe-sito-di-prova</AssemblyName>
|
||||
<RootNamespace>Febe.SitoDiProva</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SkiaSharp" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" />
|
||||
<ProjectReference Include="..\..\src\Febe.Core\Febe.Core.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<!-- Due filmati minuscoli generati una volta con ffmpeg (con e senza audio): ogni file servito è reso unico
|
||||
|
||||
@@ -97,7 +97,7 @@ pagina { altro, dopo }
|
||||
del post la danno intera (è il caso «Post singolo»).
|
||||
- Cursori opachi `c{n}`.
|
||||
- Gli indirizzi dei file sono firmati e scadono: `/m/{chiave}/{L}x{A}.jpg?scad={unix}&firma={hmac}` (durata
|
||||
predefinita 6 ore). Un indirizzo scaduto riceve 403. Le foto sono generate con SkiaSharp dalla chiave (stessa
|
||||
predefinita 6 ore). Un indirizzo scaduto riceve 403. Le foto sono disegnate dal disegnatore e dal codificatore JPEG di Febe.Core dalla chiave (stessa
|
||||
chiave, stessa immagine a ogni dimensione); i video sono due MP4 minuscoli generati una volta con ffmpeg
|
||||
(`Risorse/filmato-con-audio.mp4`, `Risorse/filmato-muto.mp4`), resi unici aggiungendo in coda un riquadro `free`.
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
using System.Buffers.Binary;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Security.Cryptography;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using SkiaSharp;
|
||||
using Febe.Core.Codecs.Images;
|
||||
using Febe.Core.Drawing;
|
||||
|
||||
namespace Febe.SitoDiProva;
|
||||
|
||||
/// <summary>
|
||||
/// Generates the files the «CDN» serves: JPEG pictures drawn with SkiaSharp from the media key (same key, same
|
||||
/// Generates the files the «CDN» serves: JPEG pictures drawn with Febe's own canvas and JPEG writer from the media key (same key, same
|
||||
/// picture at every size) and short MP4 videos made unique with a trailing «free» box. Results are cached.
|
||||
/// </summary>
|
||||
public sealed class MediaFactory
|
||||
@@ -39,45 +41,34 @@ public sealed class MediaFactory
|
||||
{
|
||||
var seed = BinaryPrimitives.ReadInt32LittleEndian(SHA256.HashData(Encoding.UTF8.GetBytes(key)));
|
||||
var random = new Random(seed);
|
||||
using var bitmap = new SKBitmap(new SKImageInfo(width, height, SKColorType.Rgba8888, SKAlphaType.Premul));
|
||||
using (var canvas = new SKCanvas(bitmap))
|
||||
using var image = new RgbaImage(width, height);
|
||||
using (var canvas = new Canvas(image))
|
||||
{
|
||||
SKColor RandomColor() => new((byte)random.Next(256), (byte)random.Next(256), (byte)random.Next(256));
|
||||
using (var background = new SKPaint())
|
||||
{
|
||||
background.Shader = SKShader.CreateLinearGradient(
|
||||
new SKPoint(0, 0),
|
||||
new SKPoint(width, height),
|
||||
[RandomColor(), RandomColor(), RandomColor()],
|
||||
null,
|
||||
SKShaderTileMode.Clamp);
|
||||
canvas.DrawRect(0, 0, width, height, background);
|
||||
}
|
||||
Color RandomColor() => new((byte)random.Next(256), (byte)random.Next(256), (byte)random.Next(256));
|
||||
var background = new LinearGradientBrush(new Vector2(0, 0), new Vector2(width, height), [RandomColor(), RandomColor(), RandomColor()]);
|
||||
canvas.FillRect(0, 0, width, height, background);
|
||||
|
||||
// Shapes in relative coordinates: every size shows the same picture.
|
||||
using var paint = new SKPaint { IsAntialias = true };
|
||||
var shapes = 8 + random.Next(8);
|
||||
for (var i = 0; i < shapes; i++)
|
||||
{
|
||||
paint.Color = RandomColor().WithAlpha((byte)(150 + random.Next(100)));
|
||||
var color = RandomColor().WithAlpha((byte)(150 + random.Next(100)));
|
||||
var x = (float)(random.NextDouble() * width);
|
||||
var y = (float)(random.NextDouble() * height);
|
||||
var w = (float)((0.08 + (random.NextDouble() * 0.35)) * width);
|
||||
var h = (float)((0.08 + (random.NextDouble() * 0.35)) * height);
|
||||
if (random.Next(2) == 0)
|
||||
{
|
||||
canvas.DrawRect(x - (w / 2), y - (h / 2), w, h, paint);
|
||||
canvas.FillRect(x - (w / 2), y - (h / 2), w, h, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
canvas.DrawOval(new SKRect(x - (w / 2), y - (h / 2), x + (w / 2), y + (h / 2)), paint);
|
||||
canvas.FillEllipse(x, y, w / 2, h / 2, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using var image = SKImage.FromBitmap(bitmap);
|
||||
using var data = image.Encode(SKEncodedImageFormat.Jpeg, 85);
|
||||
return data.ToArray();
|
||||
return JpegEncoder.Encode(image, new JpegEncoderOptions { Quality = 85 });
|
||||
}
|
||||
|
||||
private static byte[] ReadResource(string name)
|
||||
|
||||
@@ -83,6 +83,12 @@ public sealed partial class TestSite
|
||||
});
|
||||
yield return ("ConnessioneProva", new JsonObject { ["classe"] = ConnectionClass });
|
||||
yield return ("AvvioProva", new JsonObject { ["nonce"] = EntryNonce });
|
||||
yield return ("GiroProva", new JsonObject
|
||||
{
|
||||
["revisione"] = int.Parse(SpinRevision, CultureInfo.InvariantCulture),
|
||||
["ramo"] = SpinBranch,
|
||||
["tempo"] = int.Parse(SpinTime, CultureInfo.InvariantCulture),
|
||||
});
|
||||
foreach (var (operation, docId) in DocIds.OrderBy(d => d.Key, StringComparer.Ordinal))
|
||||
{
|
||||
yield return (operation + DocIdModuleSuffix, JsonValue.Create(docId));
|
||||
|
||||
Reference in new issue
Block a user