Images stopped showing using Smart Lencioni Image Resizer - image-resizing

I don't know what I did, but for some reason images stopped working. Some browsers show the image, but the majority don't. I'm using v1.4.1 of Lencioni Image Resizer
This image will not show:
http://www.norwegianfashion.no/wp-content/themes/norwegianfashion/image.php?width=280&height=&cropratio=2:1&image=http://www.norwegianfashion.no/wp-content/uploads/magazine/issue5/siri1_72dpi.jpg
But you can access the image here:
http://www.norwegianfashion.no/wp-content/uploads/magazine/issue5/siri1_72dpi.jpg
If I change & with &, I get the message Error: no image was specified.
http://www.norwegianfashion.no/wp-content/themes/norwegianfashion/image.php?width=280&height=&cropratio=2:1&image=http://www.norwegianfashion.no/wp-content/uploads/magazine/issue5/siri1_72dpi.jpg
Another place I'm using it, is here, and that works fine:
http://www.advicis.no/wp-content/themes/business1/image.php?width=150&height=&cropratio=1:1&image=http://www.advicis.no/wp-content/uploads/OD-puzzle-large.jpg
What could cause this?

Apparently your PHP script cannot access the url http://www.norwegianfashion.no/wp-content/uploads/magazine/issue5/siri1_72dpi.jpg.
I can, and you can, but the server on which the PHP script is running can't.
Perhaps the PHP server doesn't have the right pluging installed to do HTTP requests, or the HTTP server blocks requests coming from within.
Can you insert some debugging into image.php showing the results of each step? Or post the part of the image.php code where it retrieves the image?
Can you login to the PHP server with SSH and see if you can execute:
wget http://www.norwegianfashion.no/wp-content/uploads/magazine/issue5/siri1_72dpi.jpg
Another solution is to let image.php grab the file from the local disk instead of through a HTTP request, but that requires some redesign of that script.

Related

Forward log to http server

I have a pipeline that I run with nextflow which is a workflow framework.
It has an option of seeing real time logs on the http server.
The command to do this is like so:
nextflow run script.nf --with-weblog http://localhost:8891
But I don't see anything when I open my web browser. I have port forwarded while logging into the ubuntu instance and the python http server seems to work fine.
I will need help in understanding how I can set this up so I can view logs generated by my script on the url provided.
Thanks in advance!
In nextflow you need to be careful with the leading dashes of commandline parameters. Everything starting with two dashes like --input will be forwarded to your workflow/processes (e.g. as params.input) while parameters with a single leading dash like -entry are interpreted as parameters by nextflow.
It might be a typo in your question, but to make this work you have to use -with-weblog <url> (note that I used only a single dash here)
See the corresponding docs for further information on this:
Nextflow is able to send detailed workflow execution metadata and
runtime statistics to a HTTP endpoint. To enable this feature use the
-with-weblog as shown below:
nextflow run <pipeline name> -with-weblog [url]
However, this might not be the only problem you are encountering with your setting. You will have to store or process the webhooks that nextflow sends on the server.
P.S: since this is already an old question, how did you proceed? Have you solved that issue yourself in the meantime or gave up on it?

Upload file on easyupload.io with curl linux

I tried to upload file on file.io which has api using curl -F "file=#filename.txt" "https://file.io/"
how to achieve this using easyupload.io and validate that file is uploaded properly and also display the url for the uploaded file.
Easyupload.io uses Google Captcha in the background to prevent automatic uploading.
So I guess if there is no specific API for this site, it's not meant to be used with a script / program.
You can reverse engineer the upload process by opening the network tab in your browser's developer tools.

Image inaccessible from python script but accessible in browser

I was trying to automatically download some traffic camera photos to play around with some image object recognition scripts and I have found that some links to them will throw a 403: Forbidden error when I try to download them from Python, and yet I can access them in a browser. One such image is at this link: https://www.svz-bw.de/kamera/ftpdata/KA101/KA101_gross.jpg
This code:
urllib.request.urlretrieve("https://www.svz-bw.de/kamera/ftpdata/KA101/KA101_gross.jpg", "traffic.jpg")
Returns a 403 error for me. What gives? I can understand that perhaps these organizations are not keen on having people bog down their servers with automatic downloads and perhaps there are some GDPR-related constraints, but I am actually more curious about how they are able to detect that the request is coming from a script and not from normal use

Executing php scripts without opening browser

I want to execute a php file located in my apache server on localhost/remote from Processing. But I want to do it without opening the browser. How can I do this. The php script just adds data to mysql database using values obtained from GET request. Is this possible? Actually I tried using link("/receiver.php?a=1&b=2") but it opens a web page containing the php output.
Ideally such scripts must be generic so that it can be used as utility for both web and bash scripts, in-case you cannot change/modify script, then I would suggest to curl from terminal/bash script to make HTTP request to the given link.
Refer to this solution, as how to make request with CURL.

Image urls change while scraping in Node (works in browser console)

I'm using artoo.js for web scraping however For some reason the scraped image url's change when working with cheerio in node . i.e the original image url is :
"https://images-na.ssl-images-amazon.com/images/M/MV5BNWU4NmY3MTMtMTBmMi00NjFjLTkwMmItYWZhZWUwNDg5M2ExXkEyXkFqcGdeQXVyNDUyOTg3Njg#._V1_SX300.jpg"
However after scraping the Url turns to this url:
"http://ia.media-imdb.com/images/G/01/imdb/images/nopicture/156x231/tv-3797070466._CB522736147_.png#._V1_SX300.jpg"
If I scrape it while in chrome browser console using Artoo.js bookmark. The Url stays same as original.
Why is it changing when i use it in node?.Any Suggestions
UPDATE: Update: I think I found the issue but not the solution. It seems the scraper method runs before the correct images have loaded on page. the changed URL is just the placeholder image. How can I wait till the entire page loads.
It may be caused by some JS code. If you are using request+cheerio to scrap the page. When you make the request in node the JS code does nothing (it's not interpreted). So you are probably getting the original url before any lib or piece of code changes it. Try to look at the source code of the page in the browser Crtl+u. If it's "http://ia.media-imdb.com/images/G/01/imdb/images/nopicture/156x231/tv-3797070466._CB522736147_.png#._V1_SX300.jpg" then you will know some piece of code is doing something to change it.
Edit
If you absolutly need to run the JS to obtain the URL. You sould use phantomjs. It's a headless browser. The imaes will load. You can use it directly from nodejs or if you want a simpler way go with casperjs. I assume you're not used to scraping complicated web apps. If it's the case would go with casperjs. It's easy and it does the job. It's not as fast as using request + cheerio but it works. And you can put your code to run on a server.

Resources