InlineQueryResultArticle - thumb_url uploaded image - python-telegram-bot

Is there an option to use an image uploaded to telegram (file_id couldn't do it) inside InlineQueryResultArticle thumb_url?
notes:
I tried to get the file path using getfile() but it didn't do the trick.
even tried to upload a very small image size with no luck.
I'd like to ignore the InlineQueryResultCachedPhoto option since the design is not the same
any thoughts?
thank you!

I also checked that the telegram does not show the uploaded image, I think it is better to give the address of the picture directly.

Related

Flutter cached image is it possible to reload image instead of getting the cached image?

I'm using the package flutter_cached_network_image to load images from firebase. When a user updates his profile picture (filename is still the same) the image that is loaded is still the same as the one before the update because it is loaded from cache (because it still has the same url as before).
Is it possible to clear the picture from the cache so the new image is loaded?
Apparently there is no solution at the moment. See here: https://github.com/Baseflow/flutter_cached_network_image/issues/77
I use the version of the image in the address to get around this. Something like: https://example.com/image.jpg?version=14
I had the same issue. This helped me this:
imageCache.clearLiveImages();
imageCache.clear();
_bloc.add(ReloadEvent());
Cleaning cache and rebuilding widgets after successfully updating photo.
Like #EderBaum said, you can force puting an additional query string input, the value depends of the effect that you want, for example:
1 - Never cache
http:urlofresource.com/yourimage.jpg?version={NewRandonNumberGenerated}
You can use Random class to achieve this.
2- Reload cache based on app version
Same that before, but now, you use an version information that you can put into your global state or somewhere else to retrieve information after an update
3 - Use normal cache
Just leave the widget do the job.

how to get image Details form mobile folder location

We have image path like
cdvfile://localhost/persistent/DCIM/Camera/1395167011485.jpg.
OR
file://localhost/persistent/DCIM/Camera/1395167011485.jpg.
We need get image details using this path.Image details like Image Name,height, width.We are developing Cordova mobile apps.Please guide to us .Which plugin we need use for Details.
You don't need a specific plugin, though you could use file transfer to help with it. Something like the following will work fine:
var image = document.createElement('img');
image.src = "img/My_Image.png";
console.log(image.height);
console.log(image.width);
You might find this javascript exif library useful.

PHPExcel Load image from outside URL

Does anyone know how to make setPath() method able to load an image from outside server? Because all images is store on other server.I don't have any idea how to do that. Please help me. thanks
<pre>
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setPath('http://domain.com/images/testing.jpg');
$objDrawing->setHeight(96);
$objDrawing->setOffsetX(27);
$objDrawing->setOffsetY(40);
$objDrawing->setCoordinates('A9');
$objDrawing->setWorksheet($this->excel->getActiveSheet());
</pre>
Images can't be referenced from a URL, you need the image in your local filesystem because PHPExcel needs to extract information from that image. Use curl (or even file_get_contents()) to pull the image to the local filesystem first. Once the image has been embedded in the Excel document, you can delete the file again.
You can put false as the second option in the setPath() method. Tcpdf gets the image from the URL and PHPExcel doesn't throw an exception.

How to decode this png file?

Can anyone please help on how to open this png file: https://dl.dropboxusercontent.com/u/23248082/TEST.PNG
Also it would be great if you can tell me how it is enrcrypted or why its not opening.
It opens fine only with Meditech client. It seems Meditech is encrypting in someway.
I tried with different viewers and also tried converting it into differen format but so far no luck.
Iam also a newbie in this area. Any help would be highly appreciated.
Thanks..
Looking at it with tweakpng it seems the format is deliberately corrupted for proprietary use. There's a wrong CRC for the palette (correcting it does no good) and an invalid chunk count.
If your Meditech is the EHR (Electronic Health Record) system then you will only be able to accurately view the image by accessing it from the system. All data is encrypted for the purpose of restricting access to patient records.

File validation with header signature in PHP

Suppose i have one file a.png. In php we will validate it with extension & mime type.
In form i have make above validation so only png files are going to upload. If i make xyz.pdf to a.png it's going to valid.
I would like to validate file with header signature as in .NET.
Also while upload if image is broken then also it gives the message image is corrupted unable to upload.
In PHP we have to use exif_imagetype ? It's only for image what about files like video, audio or any file ?
For png images in php, you can also use createimagefrompng it returns FALSE if it is not a valid png image file.
You can determine the mime type of it. PHP mime_content_type will work on this but it is already deprecated in PHP 5.3. You can use file_info_file into it.
Take a look at this link for a more detailed explaination:
http://www.php.net/manual/en/function.mime-content-type.php
http://us2.php.net/manual/en/function.finfo-file.php

Resources