Appcelerator images not being saved - image

TiSDK 1.7.1
iOS 5.0
I'm attempting to take the URL of an image that is passed to the app and store it in applicationDataDirectory.
I've written a function that takes the url, creates an ImageView, passes it to .toImage() and then writes it to a file.
http://pastie.org/3064770
When I run it in the simulator and go to the applicationDataDirectory in finder to view the image it's the generic placeholder image that is stored, not the image that is being passed.
Thoughts?

I think the problem is you are saving the image when the image has not downloaded from the web yet - it has no data. The image is not available as soon as you get the image property - you have to wait for the 'load' event. Dawson Toth has a great example on how to create a caching image view which saves the file when the image has loaded. iOS only as the 'load' event doesn't fire in Android in 1.7.X.
Also, Titanium will only load the image when it is displayed on the screen. So if you want to download it in the background, use a HttpClient.

Related

Flutter Windows app crashes without error while loading multiple images from local disk

I created a multi image selector form field widget to use within a form with validation and so on, and it works fine; however, when I select 8 or more images from a file picker at once and add them to the selected images list, which would be displayed in an image widget within a GridView, the app crashes without any errors.
I even tried the app on Android to see if it happened there, but everything was OK even when I added 10+ images at a time.
I'm wondering if there's any way to debug this because I'm at a loss for what to do right now with no errors.
i've tried these:
Using a 50x50 pixel size cache for the selected image list to avoid loading a large amount of data at once
It turned out to be file_picker v4.0.0 causing the issue
Apparently, when you select files using this package, it will interact with the file, either loading it or whatnot. I'm not sure, but I discovered it by removing image widgets and only displaying the selected image paths using a text widget and it still crashed, so I was certain it was the file picker's fault and chose to use file picker cross even though it depends on file picker it was working differently and it didn't crash the app even with 20 images selected.

Hide images programmatically in iOS

Is it possible to hide pictures taken by the camera or by choosing a file (I am creating a copy of it)?
Or do I have to change the file-extension of the picture, or will it then be rejected by Apple?
I am using XLabs for taking/selecting the picture
If you save it locally as an app data file then it shouldn't be then showed in the gallery.
So, to reiterate: Save the file as an app data-file.

phone inappbrowser doesn't start from full-zoomed-out when it loads huge image

I have a window.open code to launch inappbrowser on phonegap. I use it for displaying image.
This inappbrowser has EnableViewPortScale=yes, so it's totally zoomable.
However, it seems like there is zoom-out-limit in inappbrowser. Here is the code.
window.open(myFullImageUrl, '_blank',
'location=no,EnableViewPortScale=yes,presentationstyle=pagesheet');
It's already zoomed-in a little. I can zoom-in-and-out because of EnableViewPortScale=yes for sure.
However, it seems like there is zoom-out-limit.
when i load up 1024x768 photo, it doesn't show fully zoomed-out photo(on both iOS and Android), but it's like 120%-ish already zoomed in.
I Just created stackoverflow account, so i can't upload photo. sorry!(it says i need 10 reputations to upload image)
There is no true solution for this issue.
So what I did is I just continue using inAppBrowser, but just instead of directly loading image from Amazon server(that's where I stored all images), I just made my window.open to go to another my URL and attach that url as a parameter after '?'.
The reason why I did this is because then I can force the Image web-view to have brief Javascript and CSS to render this dang-image correctly.
And as you guys know, this page must have meta-data that allows user-scale true, and must NOT have max-scale value.
So, Yep. Long story short, If you DIRECTLY load up the image in the inAppBrowser of phonegap, there is NO WAY you can force the image to start with 'not even slightly zoomed-in, but perfectly zoomed-out to the max'. Your own Page, Your own JS and CSS is the way to go guys.

Opening an image in TImage from a server

I am working on a huge project using Delphi XE5, the core of the program is to open an image using the TImage component on the application but the image is on a server that is accessed trough the internet. The image that displays depends on the criteria set trough other events or actions from the user. I already have the criteria's code etc in place, I only neet die Image display part..
What other components do I need to use other than TImage component to make this happen and how does one do this? I have been searching for answers for more than a week and couldn't find something that works.
This is also a multi platform application.
Found what I was looking for at FireMonkey iOS RAD Studio XE2 - Display Image on form loaded from URL although its a bit slow, but for now it can do the job just fine.
Well you can load a TBitmapImage or TJPEGImage from a stream and then stick it into your TImage. However, you will need to know the image type before you do this. Here is an example using TJPEGImage: JPEG data-stream to TImage

Mac dashboard widgets not loading external images

I set out to make a quick Mac OS X dashboard widget. I read the documentation and was pleased to find out they use simple HTML, JS, and CSS. I created my widget and it works when I open the .html file in Firefox, but it does not work when I install the widget to the dashboard.
The widget is simple: it displays the most recent image from a weather web cam stream. The image URLs look like this: http://webcam.com/stream.jpg?1274213999617. The timestamp is appended to the URL and the server automatically responds with the latest image for that time. I did not write the server script.
The widget appears to be loading correctly, but the web cam image will not load. Notice the blue question mark in the upper left. The image should appear over the square background image. Is there any special procedure for loading external images into a widget?
alt text http://img.skitch.com/20100518-pfesqbaby8dcg6yet8wjay7n1c.jpg
You should look here for some important settings:
Dashboard Info.plist Keys

Resources