init
This commit is contained in:
commit
de73fc619a
3560 changed files with 747274 additions and 0 deletions
7
scripts/SCRIPT.fish
Executable file
7
scripts/SCRIPT.fish
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
for image in *.png
|
||||
gm convert -resize 1000 $image ok-$image.png
|
||||
end
|
||||
|
||||
flaca -p *
|
||||
19
scripts/SUBSET.fish
Executable file
19
scripts/SUBSET.fish
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
pyftsubset \
|
||||
lato-variable-italic.ttf \
|
||||
--desubroutinize \
|
||||
--flavor=woff2 \
|
||||
--layout-features-="dnom,frac,numr" \
|
||||
--layout-features+="case,pnum,tnum" \
|
||||
--output-file="lato-variable-italic-webfont.woff2" \
|
||||
--unicodes="U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD" \
|
||||
--with-zopfli
|
||||
|
||||
|
||||
pyftsubset \
|
||||
lato-variable-italic.ttf \
|
||||
--desubroutinize \
|
||||
--layout-features-="dnom,frac,numr" \
|
||||
--layout-features+="case,pnum,tnum" \
|
||||
--output-file="lato-variable-italic-webfont.ttf" \
|
||||
--unicodes="U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD" \
|
||||
--with-zopfli
|
||||
47
scripts/remove-scaled-images.php
Executable file
47
scripts/remove-scaled-images.php
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
require_once "web/wp/wp-load.php";
|
||||
|
||||
ini_set("max_execution_time", 3600);
|
||||
set_time_limit(3600);
|
||||
|
||||
$pdo = new PDO("mysql:dbname=haiku_atelier;host=localhost", "haiku_utilisateur", "spNFx5EAYwvF7o7XFMjiHpNPYJimDtmKWv");
|
||||
|
||||
/**
|
||||
* replace _wp_attached_file meta_key
|
||||
**/
|
||||
|
||||
global $wpdb;
|
||||
$wp_postmeta = $wpdb->prefix . "postmeta";
|
||||
|
||||
try {
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //Error Handling
|
||||
|
||||
$sql = "UPDATE $wp_postmeta SET meta_value = REPLACE(meta_value,'-scaled.jpg','.jpg') WHERE meta_key='_wp_attached_file' AND meta_value LIKE '%-scaled.jpg%'";
|
||||
$result = $pdo->exec($sql);
|
||||
print_r($result);
|
||||
} catch (PDOException $e) {
|
||||
print_r($e->getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* replace _wp_attachment_metadata meta_key
|
||||
**/
|
||||
|
||||
$image_metas = [];
|
||||
try {
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //Error Handling
|
||||
$sql = "SELECT * FROM $wp_postmeta WHERE meta_value LIKE '%-scaled.jpg%' AND meta_key='_wp_attachment_metadata'";
|
||||
$statement = $pdo->query($sql);
|
||||
$image_metas = $statement->fetchAll();
|
||||
foreach ($image_metas as $meta) {
|
||||
$meta_value = unserialize($meta["meta_value"]);
|
||||
$file = $meta_value["file"];
|
||||
$meta_value["file"] = str_replace("-scaled.jpg", ".jpg", $file);
|
||||
update_post_meta($meta["post_id"], $meta["meta_key"], $meta_value);
|
||||
$result = get_post_meta($meta["post_id"], $meta["meta_key"]);
|
||||
print_r($result);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
print_r($e->getMessage());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue