cdowdy / bolt-tinypng Goto Github PK
View Code? Open in Web Editor NEWBolt Extension Using TinyPNG API to optimize images
Bolt Extension Using TinyPNG API to optimize images
Is it doable? Is it considered? I would like to help to make it happen if possible.
this makes it very "noisy" so I wanna remove it.. also related to #28
see bolt/bolt#7483
that gets fixed/updated or bolt developers decide that hey people wanting to fix your undocumented usage of something is something they'll like I'll return to maintaining this.
As of right now if you're not a core developer of bolt good luck having any input.
Wrong: If you choose either fit or cover as a resize method you must provide and with and height.
Correct: If you choose either fit or cover as a resize method you must provide a width and height.
Bob Lauckhart asked about the directories being sorted in the directory tab.
If you have a lot of directories the way they are currently displayed may take up a lot of screen real estate.
They asked if we could sort the directories in Ascending or Descending order*.
Sooooo this issue is here for anyone else to come across and see its being implemented :)
Hey,
the ConfigHelper uses PHP7 Features, but in the composer.json is php7 not required
Now that I have the base functionality that I'd use/want I need to refactor this code so its easier to maintain / update and add.
right now I'd like to with time permitting to:
if ( $directory == 'index' ) {
$fileList = $filesystem->listContents( null, false );
} else {
$fileList = $filesystem->listContents( $directory, false );
}
if ( $directory == 'index' ) {
$newImagePath = $filesPath . '/' . $newImageName;
} else {
$newImagePath = $filesPath . '/' . $directory . '/' . $newImageName;
}
if ( $directory == 'index' ) {
$uploadDir = '';
} else {
$uploadDir = $directory . '/';
}
move the flysytem stuff into its own class so we can easily reuse it "more better"
add optimized, optimized renamed, and uploaded files to the file list from the json response retrieved from the ajax endpoint
*add option to delete a directory
add option to copy/clone an image
add metadata preservation options to the image upload
with time permitting move to a service
clean up templates - they are currently a mess and I know what they do since I built them :) haha
bolt-tinypng/src/Helpers/FilePathHelper.php
Lines 34 to 42 in 0794f3c
Server Errors (like a server timeout 504) aren't shown in the UI and the buttons are still disabled.
The error is logged in the console but not shown to a user unaware of the console.
I get my site's 404 when trying to open the extension route: /bolt/extend/tinypng/files
Getting the error Variable "title" does not exist in "tinypng.imageoptimization.html.twig" at line 4.
when running this extension and accessing the TinyPNG menu. Running Bolt 3.2.14
wrong data to preserve is passed in the handler
bolt-tinypng/src/Handler/TinyPNGOptimize.php
Lines 77 to 78 in d57a829
Allow a user to upload an image, optimize this / these images with the tiny/png/jpg api and restrict those to a specific size.
This would allow developers to enter a config setting that would take very big images - say 4000px by 4000px and on the upload resize those proportionally to a specific size. Like 1200px by 1200px. That way if a client or someone else uploaded big images we wouldn't have to worry about sizes or big ass images.
bolt 3.3 decided to make a breaking change in a minor version. No longer are back end pages access from :
/bolt/extend/backend-page
.
Extend has been changed to 'extensions'.
dropzone looks for the preview template with
previewTemplate: document.getElementById('dropzone-preview').innerHTML,
This causes errors on pages without the the upload form
used:
Every once in a while when you batch upload into a directory sometimes the UI gets stuck and doesn't update. All the files successfully upload , get resized and optimized and saved to the server. The UI just gets stuck somewhere in the ether
The method checkAccpetedTypes
is misspelled.
I left autodiscover on :) so Dropzone js will try to find our upload form on backend pages that don't use the tinypng api/extension all that jazz.
Specifically:
Uncaught Error: No URL provided.
at new Dropzone (dropzone.js:440)
at Function.Dropzone.discover (dropzone.js:1479)
at Dropzone._autoDiscoverFunction (dropzone.js:1761)
at HTMLDocument.init (dropzone.js:1730)
So we'll turn off autodisover since we can't restrict our custom pages/extensions to particular backend pages and init it only when the id of our form is found. Hopefully this doesn't break anything haha.
CHeck to make sure the user has the proper permissions to upload files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.