Posts

Showing posts from 2021

Scroll through images in carousel using Jquery and download the images using curl batch script

 There might be two kinds of carousels. Carousel type 1 :  the one in which image tag's src is already loaded with its original image URL. For such carousel just execute below script in browser dev tool's snippet portion. async function myFunction(){ var first = "" ; var firstDone = false ; var lastDone = false ; while ( ! lastDone){ if (first == ($( ".photo-container > .photo-controls-wrapper > img" ).attr( "src" ))){ lastDone = true ; break ; } if ( ! firstDone){ first = $( ".photo-container > .photo-controls-wrapper > img" ).attr( "src" ); firstDone = ! firstDone; } console.log($( ".photo-container > .photo-controls-wrapper > img" ).attr( "src" )); $( ".navigation-button-right" ).click(); await sleep( 2000 ); } } function sleep(ms) { re...

Loop through files in current directory and compress them using image magick

 @ECHO OFF FOR %%i IN (*) DO ( echo "Executing:: magick %%i -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB %%~nf_converted.jpg" magick %%i -sampling-factor 4:2:0 -strip -quality 65 -interlace JPEG -colorspace RGB %%~ni_converted.jpg ) pause;