From 8994ceb40561f8a8997c1ccb39bb4b0204bd7159 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 6 Dec 2018 18:23:11 +0100 Subject: [PATCH 1/5] [CI] Push release notes to Gitlab tag --- .gitlab-ci.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af0cd93..de3c8c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ image: hatsoftwares/lutim-test-ci:latest stages: + - publish_changelog - podcheck - carton - carton_bdd @@ -15,25 +16,29 @@ variables: ### Jobs templates ## # -.carton_bdd_template: &carton_bdd_definition - stage: carton_bdd +.retry: &retry retry: 2 + except: + - tags +.carton_bdd_template: &carton_bdd_definition + <<: *retry + stage: carton_bdd artifacts: paths: - local/ dependencies: - carton .sqlite_template: &sqlite_definition + <<: *retry stage: tests - retry: 2 artifacts: paths: - cover_db/ dependencies: - carton_sqlite .pg_template: &pg_definition + <<: *retry stage: tests - retry: 2 artifacts: paths: - cover_db/ @@ -43,10 +48,26 @@ variables: - name: postgres:9.6 alias: postgres +### Publish tag changelog +## +# +publish_changelog: + image: hatsoftwares/curl-jq:latest + stage: publish_changelog + script: + - export PROJECT_API_URL="https://framagit.org/api/v4/projects/${CI_PROJECT_ID}" + - export DESCRIPTION_URL="${PROJECT_API_URL}/repository/tags/${CI_COMMIT_TAG}/release" + - 'export HEADER="Private-Token: ${GITLAB_API_TOKEN}"' + - sed -n '/^'$CI_COMMIT_TAG'[[:space:]]/,/^[^\t]/p' CHANGELOG | sed -e 's/^[^\t].*//' -e 's/\t//g' | sed '/^[[:space:]]*$/d' > /tmp/text + - if [[ ! -z $GITLAB_API_TOKEN ]]; then curl -s --request POST --data-urlencode "description@/tmp/text" --header "${HEADER}" "${DESCRIPTION_URL}"; fi + only: + - tags + ### Podcheck ## # podcheck: + <<: *retry stage: podcheck script: - make podcheck @@ -55,6 +76,7 @@ podcheck: ## # carton: + <<: *retry stage: carton artifacts: paths: @@ -63,7 +85,6 @@ carton: script: - carton install --deployment --without=sqlite --without=postgresql --without=minion --without=cache --without=memcached when: always - retry: 2 ### Install DB related dependencies ## From 6cdcd9a88da9a8c2295ca95beefdb0a11749a585 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 19 Apr 2019 17:26:34 +0200 Subject: [PATCH 2/5] Remove transifex files --- .tx/config | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .tx/config diff --git a/.tx/config b/.tx/config deleted file mode 100644 index 057b52d..0000000 --- a/.tx/config +++ /dev/null @@ -1,8 +0,0 @@ -[main] -host = https://www.transifex.com - -[lutim.enpo] -source_file = lib/Lutim/I18N/en.po -source_lang = en -type = PO -file_filter = lib/Lutim/I18N/.po From dee0101496857ac41c91b57144770c4164888315 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 19 Apr 2019 17:42:40 +0200 Subject: [PATCH 3/5] =?UTF-8?q?[gallery]=20Fix=20#99=20=E2=80=94=20Use=20J?= =?UTF-8?q?S=20to=20find=20images=20width/heigth=20if=20not=20provided?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/templates/partial/gallery.js.ep | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/themes/default/templates/partial/gallery.js.ep b/themes/default/templates/partial/gallery.js.ep index cc9bc5d..d39b2b9 100644 --- a/themes/default/templates/partial/gallery.js.ep +++ b/themes/default/templates/partial/gallery.js.ep @@ -214,6 +214,26 @@ function addAlert(e) { ].join('')); } +function appendToGallery(url, width, height) { + $('.gallery').append( + [ + '
', + ' ', + ' ', + ' ', + '
' + ].join('') + ); +} + +function nextOrInitGallery(keys) { + if (keys.length > 0) { + addElement(keys); + } else { + initPhotoSwipeFromDOM('.gallery'); + } +} + function addElement(keys) { element = keys.shift(); if (!element.match('xcf')) { @@ -223,29 +243,29 @@ function addElement(keys) { dataType: 'json', success: function(data, textStatus, jqXHR) { if (data.success) { - $('.gallery').append( - [ - '
', - ' ', - ' ', - ' ', - '
' - ].join('') - ); + if (data.data.width && data.data.height) { + appendToGallery(absUrl+element, data.data.width, data.data.height); + nextOrInitGallery(keys); + } else { + var img = new Image(); + img.onload = function(){ + appendToGallery(absUrl+element, img.width, img.height); + nextOrInitGallery(keys); + } + img.src = absUrl+element; + } } else { addAlert(data.msg); + nextOrInitGallery(keys); } }, - complete: function() { - if (keys.length > 0) { - addElement(keys); - } else { - initPhotoSwipeFromDOM('.gallery'); - } + error: function(jqXHR, textStatus, errorThrown) { + nextOrInitGallery(keys); } }); } } + $(document).ready(function() { var key = window.location.hash.substring(1); // Get key // First, strip everything after the equal sign (=) which signals end of base64 string. From d709a607afc5b156081e446dd089838e49836639 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 19 Apr 2019 17:48:17 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Fix=20#97=20=E2=80=94=20Revert=20"Fix=20#90?= =?UTF-8?q?=20=E2=80=94=20catch=20Image::Magick=20problems"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 998db0cb90b416f92d78edfd67bdd493cbfae62a. --- lib/Lutim/Controller/Image.pm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/Lutim/Controller/Image.pm b/lib/Lutim/Controller/Image.pm index 5658513..e3bbc62 100644 --- a/lib/Lutim/Controller/Image.pm +++ b/lib/Lutim/Controller/Image.pm @@ -401,25 +401,25 @@ sub add { my ($width, $height); if ($im_loaded && $mediatype ne 'image/svg+xml' && $mediatype !~ m#image/(x-)?xcf# && $mediatype ne 'image/webp') { # ImageMagick don't work in Debian with svg (for now?) my $im = Image::Magick->new; - if($im->BlobToImage($upload->slurp)) { - # Automatic rotation from EXIF tag - $im->AutoOrient(); + $im->BlobToImage($upload->slurp); - # Update the uploaded file with it's auto-rotated clone - my $asset = Mojo::Asset::Memory->new->add_chunk($im->ImageToBlob()); - $upload->asset($asset); + # Automatic rotation from EXIF tag + $im->AutoOrient(); - # Create the thumbnail - $width = $im->Get('width'); - $height = $im->Get('height'); - $im->Resize(geometry=>'x85'); + # Update the uploaded file with it's auto-rotated clone + my $asset = Mojo::Asset::Memory->new->add_chunk($im->ImageToBlob()); + $upload->asset($asset); - $thumb = 'data:'.$mediatype.';base64,'; - if ($mediatype eq 'image/gif') { - $thumb .= b64_encode $im->[0]->ImageToBlob(); - } else { - $thumb .= b64_encode $im->ImageToBlob(); - } + # Create the thumbnail + $width = $im->Get('width'); + $height = $im->Get('height'); + $im->Resize(geometry=>'x85'); + + $thumb = 'data:'.$mediatype.';base64,'; + if ($mediatype eq 'image/gif') { + $thumb .= b64_encode $im->[0]->ImageToBlob(); + } else { + $thumb .= b64_encode $im->ImageToBlob(); } } From 78da85115cfc1ad7ea0b4e8f699274714a9b145f Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 19 Apr 2019 17:54:50 +0200 Subject: [PATCH 5/5] Update CHANGELOG --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 330167b..6a43b29 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ Revision history for Lutim +0.11.5 2019-04-xx + - Revert catching Image::Magick problems + - In gallery, use JS to find image's width and height if not provided by image's infos + 0.11.4 2018-11-18 - Catch Image::Magick problems - Update arabic translation