I have installed levelten_apps and it is downloading images like the one from this URL:

http://apps.leveltendesign.com/sites/default/files/screenshots/webform_s...

which is a wrong url. Method apps_retrieve_app_image should check if it has downloaded a right image before saving it to drupal public files.

I'm attaching a possible patch

Comments

Status:Active» Needs review
StatusFileSize
new831 bytes

Patch works great for me and fixed a whack of problems when an app is installed locally using a manifest.app and the file permissions make the screenshot + logo inaccessible.

Rerolled the patch so will work with drush make.

Should also likely be used in conjunction with:

http://drupal.org/node/1721538

StatusFileSize
new783 bytes

Applied to wrong branch here is the proper patch

Status:Needs review» Needs work

+++ b/apps.manifest.incundefined
@@ -265,11 +265,16 @@ function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) {
+    else {
+      // TODO delete managed file object
+      file_unmanaged_delete($current->uri);

What is this part of the patch doing?

StatusFileSize
new597 bytes

Here's an alternate patch that fixes the same error for missing webform_screenshot.png in a different approach - it returns current file info if the http request has an error. Probably use both the above to not save the bad ".png" file and this one to handle missing files in http requests even if the current file is valid.

(See also http://drupal.org/node/1908824)

Status:Needs work» Closed (duplicate)

Marking this as a duplicate of #2081587: When an app tries to download an invalid logo a random placeholder file is created as that issue has a patch that applies to the current HEAD, and also checks if the downloaded file is an actual image.