Unable to get file name Uning UIImagePickerController - uiimagepickercontroller

I am newbie in swift i stuck in a little problem. I am attaching image using UIImagePickerController. Good thing is that successfully attached an image but unable to get attached file name. I tried several solutions like
UIImagePickerControllerImageURL, UIImagePickerControllerImageRefrenceURL,
UIImagePickerControllerPHAsset but didn't succeeded Please guide me and thanks in advance

As per your question, you will get your point in the didFinishPickingMediaWithInfo method , where you get info object in above method in that included all info about your file.
Check below code:
let imageURL = info[UIImagePickerControllerImageURL] as! URL
print(imageURL.lastPathComponent)
Happy coding.

Related

Why I can't access to RunCommandLineApplicationAsync?

I'm trying to build CLI. I took an example here
And in Program class author use return await builder.RunCommandLineApplicationAsync<TestCmd>(args);
Like a start point of program, but when i'm trying to do the same i have an error:
How can I solve this issue?
I figured out why, because i thougth that it's from Microsoft.Hosting, but i need to intall this package: McMaster.Extensions.Hosting.CommandLine.
Close please this topic

Can't create firebase indexing due to this message This page has moved to new location. Please update your bookmarks

When I try to create a firebase indexing through the link that is created automatically it shows in a popup message "This page has moved to a new location. Please update your bookmarks." and it doesn't create the firebase indexing
can someone help me?
a screenshot of the message shown
My link was without the "database" word already, but when I changed the:
..google.com/v1/r/... to ..google.com/u/0/...
it worked. Note the "v1" and "r" is replaced in the working link for me.
I am using Flutter. Could be the Flutter Firestore package that needs updating, I don't know where the link is populated from exactly.
Just copy the url in the console, and remove /database/
For Eg,
Convert this
https://console.firebase.google.com/u/0/project/project-name/database/firestore/indexes?......
to,
https://console.firebase.google.com/u/0/project/project-name/firestore/indexes....
firebaser here
It indeed seems like something has been broken in a recent update. Thanks everyone for posting workarounds so quickly!
We have rolled back the change for now, so you should no longer be seeing this error. If you still see the error, please leave a comment below.

wx python get icon from blob

Can anyone please point me to a resource that will help me get an icon from blob in wx.python
I can do it from a file
ico = wx.Icon('bfgIcon.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
but I cannot seem to find the correct way of doing it from an sql blob. I've tried
row=uc.Users().GeneralImageRow('bfgLogo')
stream=wx.InputStream(StringIO(row[1]))
image=stream.GetIcon()
self.SetIcon(image)
but I've clearly got the object architecture wrong
Can anyone please help?
OK. Got it here
row=uc.Users().GeneralImageRow('bfgLogo')
stream=wx.InputStream(StringIO(row[1]))
icon=wx.IconFromBitmap(wx.BitmapFromImage(wx.ImageFromStream(stream,wx.BITMAP_TYPE_PNG)))
self.SetIcon(icon)

import a google static map directly in fpdf

I wanted to place a google static map in a pdffile generated by using the fpdf extension.
and used code to make a tempfile first. Using this code. However I run into an error ('can't open image file').
// define the mapurl
$fullURL = 'http://maps.googleapis.com/maps/api/staticmap?center=Amsterdam&z=14&size=100x100&sensor=false';
// create a tempfile
$tempF = tmpfile();
fwrite($tempF, file_get_contents($fullURL));
//Rewind to the start of file
rewind($tempF);
// place the image in the pdf.
if (!empty($tempF)) {
$this->Image($tempF,$start_x, $this->GetY(),0,100);
}
fclose($tempF); // remove the tempfile
Note: OP's own answer extracted from the question.
Then I found out it can be done much easier... I don't need to use a tempfile. If I put the url in the image variable and give a format the thing works in two lines.. I don't use the height and width parameters in fpdf because they stretch the image into a unreadable form.
$fullURL = "http://maps.googleapis.com/maps/api/staticmap?center=". \
$row-Google_coor."&zoom=10&size=2200x200\
&markers=color:blue%7Clabel:D%7C".$row->Google_coor;
$this->Image($fullURL,$start_x, $this->GetY(),0,0,"PNG");
Saddly when using this function sometimes the program returns an error. The image could not be found. But when I put the url string in the browser the image shows up fine. Hopefully this is also a minor fallback.
Lets see if I find a solution on the google apis site https://developers.google.com/maps/documentation/staticmaps/?csw=1
For what it is worth I had this problem as well, I found that my server had an outgoing connections manager, this would automatically block the request, I had to add the ip, once this was done it worked fine.
I had a problem similiar to the OP's. I was getting an error when using FPDF and trying to get the static map image from Google Maps and into my PDF. I was getting "FPDF error: Missing or incorrect image file". What I did is to register in the Google Developer Console and get an API Key, just like they say in the documentation
Hope this helps.
You can download the image and use it with fpdf
$url ="https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284&key=".$googleApiKey;
$img = __DIR__.'/img/map.png';
file_put_contents($img, file_get_contents($url));
$pdf->Image($img,null,null,170);
Hope that this will be helpful

Error: is not a valid virtual path

I used something like
Dim i As String
i = Server.MapPath("~/photos/") + fileName
Only once in a project that was working and online, on the offline version, when I run it on my machine, its working, no errors, I uploaded it, it gave me an error like:
'~/photos/http://www.MyURL.com/photos/4411568359267Pic003.jpg' is not a valid virtual path.
Indicating a line in my code:
var marker = new GMarker(new GLatLng(<%=coordinates%>));
This have never happened before, and I don't know where to start troubleshooting as this script -Google Maps- doesn't even need images, i tried to comment it out, it gave me the same error but on a different script this time, the one that show formatting toolbar for the text areas
Line 8: new nicEditor({buttonList : ['fontSize','fontFamily','fontFormat','bold','italic','underline','strikethrough','forecolor','bgcolor','removeformat'], iconsPath : '../nicEdit/nicEditorIcons.gif'}).panelInstance('<%= txtDescription.ClientID %>');
..please HELP :'(
can you post your fileupload aspx page and your function so we can troubleshoot it.
"'~/photos/http://www.MyURL.com/photos/4411568359267Pic003.jpg'"
look closely at the url, it is tacking the full url on to "i". what type of control or you using, a generic or a server side control
solved, turns out the error is due to old database records when i was storing the whole path in the fileName...Thanks Joshua and Keltex

Resources