Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Commit

Permalink
New feature: use progressive JPEG; set version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiaverga committed Jun 2, 2017
1 parent f022ffd commit a2cde44
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Automatic Intro Image needs IMagick php module to be installed and enabled on yo
See https://github.com/mattiaverga/JAutomaticIntroImage/wiki for more help.

## Changelog
### v1.3
* New feature: use progressive JPEG

### v1.2
* New feature: image in subdirectory
* New feature: set custom JPEG compression
Expand Down
5 changes: 5 additions & 0 deletions automaticintroimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public function onContentBeforeSave($context, $article, $isNew)
$thumb->setImageCompressionQuality($compression_level);
}

if ($this->params->get('SetProgressiveJPG') == 1)
{
$thumb->setInterlaceScheme(Imagick::INTERLACE_PLANE);
}

// Get real image dimensions if maintain aspect ratio was selected
if ($this->params->get('MaintainAspectRatio') == 1)
{
Expand Down
15 changes: 12 additions & 3 deletions automaticintroimage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<extension version="3.2" type="plugin" group="content" method="upgrade">
<name>Content - Automatic Intro Image</name>
<author>Mattia Verga</author>
<creationDate>20 November 2016</creationDate>
<copyright>Copyright (C) 2016 Mattia Verga. All rights reserved.</copyright>
<creationDate>2 June 2017</creationDate>
<copyright>Copyright (C) 2017 Mattia Verga. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later.</license>
<authorEmail>[email protected]</authorEmail>
<version>1.2</version>
<version>1.3</version>
<description>PLG_CONTENT_AUTOMATICINTROIMAGE_XML_DESCRIPTION</description>
<files>
<filename plugin="automaticintroimage">automaticintroimage.php</filename>
Expand Down Expand Up @@ -99,6 +99,15 @@
required="1"
showon="ChangeImageQuality:1"
/>

<field name="SetProgressiveJPG" type="radio"
default="1"
description="PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_DESCRIPTION"
label="PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_LABEL"
>
<option value="0">PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_NO</option>
<option value="1">PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_YES</option>
</field>
</fieldset>
<fieldset name="misc" label="PLG_CONTENT_AUTOMATICINTROIMAGE_FIELD_MISC_LABEL">
<field name="CopyAltTitle" type="radio"
Expand Down
2 changes: 2 additions & 0 deletions language/en-GB/en-GB.plg_content_automaticintroimage.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_IMGQLTY_LABEL="Compression level (50-100)"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_IMGQLTY_DESCRIPTION="JPEG compression level."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_HEIGHT_LABEL="Height of resized image (10-2000)"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_HEIGHT_DESCRIPTION="Set the height of the resized image. If 'maintain aspect ratio' option is selected, this value will act as the max height of the resized image."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_DESCRIPTION="If the original image is a JPG, the generated thumbnail will be a progressive JPG. This parameter has no effect on other image types."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_LABEL="Use progressive JPG"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PUTSUBDIR_LABEL="Put in subdir"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PUTSUBDIR_DESCRIPTION="Put the intro image in a subdirectory. The path of the subdirectory is relative to the original image path."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_RATIO_LABEL="Maintain aspect ratio"
Expand Down
2 changes: 2 additions & 0 deletions language/it-IT/it-IT.plg_content_automaticintroimage.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_IMGQLTY_LABEL="Livello di compressione (50
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_IMGQLTY_DESCRIPTION="Livello di compression JPEG."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_HEIGHT_LABEL="Altezza immagine (10-2000)"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_HEIGHT_DESCRIPTION="Imposta l'altezza dell'immagine ridimensionata. Se è abilitata l'opzione 'Mantieni proporzioni', questo valore sarà la massima altezza che l'immagine ridimensionata potrà assumere."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_DESCRIPTION="Se l'immagine originale è JPG, la miniatura sarà generata come JPG progressivo. Questo parametro non ha effetto su altri tipi di immagine."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PROGRESSIVE_LABEL="Usa JPG progressivo"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PUTSUBDIR_LABEL="Genera in sottodirectory"
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_PUTSUBDIR_DESCRIPTION="Genera l'immagine introduttiva in una sottodirectory. Il percorso della sottodirectory è relativo all'immagine originale."
PLG_CONTENT_AUTOMATICINTROIMAGE_PARAM_RATIO_LABEL="Mantieni proporzioni"
Expand Down

0 comments on commit a2cde44

Please sign in to comment.