We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flickr
#1
I have previously fixed issues with Small Basic Flickr command, due to changes in flickr api.

I had a look at it again as it doesn't work and determined that this time the api key has expired.  I got a new api key and updated LDUtilities.FixFlickr.  It seems to need to download the file rather than just load with ImageList, but the following works (Beta 1.2.25.0).

Code:
LDNetwork.SetSSL()
flickr = LDUtilities.FixFlickr()
imageURL = Flickr.GetRandomPicture("Car")
tmpFile = File.GetTemporaryFilePath()
LDNetwork.DownloadFile(tmpFile,imageURL)
image = ImageList.LoadImage(tmpFile)
File.DeleteFile(tmpFile)
GraphicsWindow.DrawResizedImage(image,0,0,GraphicsWindow.Width,GraphicsWindow.Height)
[-] The following 1 user Likes litdev's post:
  • Nonki Takahashi
Reply
#2
LitDev,

Before I found this I opened a thread in your small basic section asking if it would be possible to fix flickr. So, with the above it seems like loadimage isn't working in smallbasic for flicker. Is it possible to fix that?

JR
Reply
#3
Hi JR,

It does seem that way, that Flickr is somehow different.  I don't know why this is, so unsure how it could be fixed.  I will have a play and see if I can diagnose the issue, but at the momement the file download seems the only way for Flickr.
Reply
#4
After trying a couple things I am no wiser, so added a method that does the file download stuff behind the scenes.

Code:
LDNetwork.SetSSL()
flickr = LDUtilities.FixFlickr()
imageURL = Flickr.GetRandomPicture("Car")
image = LDImage.LoadImage(imageURL)
GraphicsWindow.DrawResizedImage(image,0,0,GraphicsWindow.Width,GraphicsWindow.Height)

This is in current Beta version 1.2.26.0, the image is put in the main Imagelist.
[-] The following 1 user Likes litdev's post:
  • jrmrhrb00
Reply
#5
LitDev,

I have the right version loaded 1.2.26.0, but it says it can't find operation loadimage in ldimage.

JR
Reply
#6
Hi JR,
Not sure when you got the Beta version and when I uploaded it with new command (LDImage.LoadImage), but I just tested the Beta download and its there for me.
Reply
#7
LitDev,

Just loaded it again and it is still not there. Here is what is in the ldimage dropdown list:

GetWorkingImagePixelARGB
HeightMap2NormalMap
Histogram
LoadSVG
MakeTransparent
MetaData
Multiply

I expect that you had updated the intellisense. I still get the error and it doesn't show in the intellisense.

"Cannot find the operation loadimage in ldimage".

JR
Reply
#8
Not sure what to suggets.  I just tested again:

Download Beta zip from my website, unblock and extract zip.  Copy dll and xml to lib folder (Small Basic closed to allow over-write).
Start Small Basic and run the test - all good.

   
Reply
#9
OK. We're on about the same timeframe. I'll try again! Let you know in a few minutes.

JR

Got it! I had renamed the old .dll and .xml to .dllOLD and .xmlOLD  and it was continuing to load them. Just deleted them and the new ones took control.

Sorry for the confusion. Somehow the new .dll and .xml were getting overlaid with the old even though I had changed the names. Although with ldutilities.version() it still showed 1.2.26.0. as the version. Thanks for the new version! Works great.

JR
[-] The following 2 users Like jrmrhrb00's post:
  • AbsoluteBeginner, litdev
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)