Image in rails asset pipeline loading indefinitely, but still appearing - ruby-on-rails

Okay so basically, I have a file in my asset pipeline (http://myapp.dev/assets/avatars/default-avatar.jpg). When I visit the URL, the image loads, but continues to act as though it's transferring data (the chrome spinner is spinning). If I access the same file in production instead of development, it works just fine. In addition, no other files have this issue, it's only that ONE jpeg in that ONE folder.
I have no clue what this could be. Can anyone help?
EDIT: This is what the network activity looks like

I had the same issue (the image would show up but continue to load for a long period of time, then the transfer would ultimately fail and the image would appear broken).
Saving the image again in Photoshop resolved it for me, as you mentioned in your comment above. Must have been something wrong with the image encoding.

Related

Uploading App Images: "Invalid GeoJSON: Your routing app coverage file is invalid."

This question is not a duplicate to another question that asks about the same message, but in another context. The context of this question is just about uploading screenshot images and getting the message.
Today, I had a new message when uploading images to App Store Connect:
Invalid GeoJSON: Your routing app coverage file is invalid.
This makes absolutely no sense since, at this time, I had not even chosen a build for the upload.
Retrying to upload the images, it worked. But unfortunately, the message appeared for each language and format.
Is this a bug by Apple or am I missing something? I would guess that uploading images has nothing to do with GeoJSON.
I used Safari. Others seem to have the problem with Chrome. So it occasionally seems to happen on all browsers.
I had this same problem today while uploading App Store Icon on Preparing for submission page. Solved it by removing "-" from my image name.
This is an unusual bug. Apple might be already working on it. It's not coming on any specific browser. It occurs mostly when we are trying to upload more than one images at once.
Apple always keeps their live site maintenance work active, so this is most likely a bug occurring in their live site maintenance. It will be fixed soon.
For now, if you are finding difficulties handling screenshot uploads, you can try to upload them one by one rather than uploading in a bulk.
Important Note:
I am stating this on basis of the last few uploads I have experienced. Also, the solution I have given is tried from my side and it worked for me well. So, you can just try it out and I'm sure that it's not a browser issue. It can occur on any browser.
It did not work for me even if I provided English file names. It kept giving the above error.
Only thing that worked for me was to remove all underscores. So instead of iphone_xs_max_1.png, it worked when I renamed it to iphone1.png and uploaded.
Make sure screenshot files name in English.
Make sure screenshot files all the directory path(and folder name) in English.
it worked for me.
I had the same bug today. Some of the images uploaded without problems, others didn't.
I was uploading in Chrome when I got the issue. Opening the site in Safari and uploading the images there, solved the problem.
What solved this for me was removing strings of numbers and periods from the filenames. It appears the system is running the filenames through some kind of geocoder, and if there are strings of characters that could be interpreted as locations, it will error out.
Make sure after editing the image you save the file with an extension like myimage.png or myimage.jpg
In my case, I forgot to save the file with extension after removing alpha and transparency properties and no need to change browser etc.

Transloadit Thumbnail Result Image Has Wrong File Extension Capitalization

I am using transloadit to generate a thumbnail image sent from an iOS app that saves both the original image and the thumbnail to Amazon S3. The files get get saved out correctly with one exception. The file name for the thumbnail does not retain the capitalization of the original filename for the file extension, i.e. JPG vs jpg. Here is my template:
I am using the fields to generate the custom path I want--which works fine, however, the output from the "store_thumb" step has this difference:
Is there any way to retain the capitalization? I realize I can just force all of my filenames from the app to lowercase, however, I thought maybe I am just doing something wrong. Any suggestions?
I'm part of Transloadit's developer support team.
First of all, let me assure you there's nothing wrong with what you're doing. Secondly, I've asked our engineers about the issue and we realized it's a limitation caused by our special usage of some of the conversion tools.
We'll do our best to address this on future versions, but we cannot commit on a date. So for now if it's causing you trouble, we recommend using lowercase letters.

status code 302 when fetching images

I've made a simple html website with bxslider component for a gallery but the images from it keep giving me a 302 response. they are camera pictures. thing is that i have other images that are not on the bxslider and not camera pictures and they load fine. when i put one of those in the gallery, they load fine too. when i open the html file, the images load fine too. im using filezilla to upload the website and im absolutely sure the links are right and the images are there. the images are 1000x750px and weigh about 300kb. also, when i try to load them outside the bxslider, they dont load too. i tried making the images incredibly smaller like 10x7px and still the same error. a friend said it was something about the color pallet or whatever and i changed it to rgb on photoshop though i may not have done it correctly, if you try to check it, the image is sam_8140.jpg. the website is: http://mheuter.besaba.com/
i wont show any code as its only html and it can be viewed in the website.
302 status is used for a redirect. Your requests are redirecting to a page with next content: The document has moved here.; hard to say why. Probably some handler or configuration of web server do this.
I think you should check it with your hosting provider maybe this issue is on their side.

Imagemagick integrated with Meteor

I am attempting to use Imagemagick to manipulate images that are uploaded by a user. Right now I have a simple set of Imagemagick.convert[ ] commands server side that preform a variety of tasks on the uploaded image. My problem comes from Imagemagick needing the file data to be read into meteor and not from a url. What I end up doing is writing the uploaded file to the /public folder where Imagemagick is able to manipulate the image. However because the list of Imagemagick.convert commands (saving and writing to /public), the application keeps refreshing, breaking up the processes and sending it into an infinite refreshing cycle. I don't think assets is a viable solution, but I need some folder that I can write to in meteor that will not interrupt the various Imagemagick processes through a refresh. I have tried the .folder for a hidden folder, but meteor gives me an error: "You can’t use a name that begins with a dot “.”, because these names are reserved for the system. Please choose another name." Any thoughts?
#Nate I wrote a little example app that solves this problem by using a temporary directory (as others have suggested):
https://github.com/ideaq/image-uploads
My solution gives you:
Easy image uploading in any Meteor app
Images are re-sized to Thumbnail, Mobile Optimised and Full-size Original
Images are uploaded to AWS S3 for CDN delivery (scalability and speed)
A thumbnail of the image is displayed on to the user without refreshing the page
if you found a better way of doing image uploads in meteor, please share! thanks. :-)

Rails passing additional params in some tag helpers

Currently image_tag("file.jpg") produces normal image html tag, BUT src="file.jpg**?7485793246**" What are those numbers anyway and how to disable them?
Those are refered to as Asset Timestamps they can be used by the server to cache files. For example lets say you have a file called file.jpg on your server, you can set up your server to tell browsers like firefox to cache the file.jpg so the next time that browser visits your web-page it loads faster because file.jpg was already in memory.
The problem comes when you upload a new file.jpg because even though the image is different, your old users who have the image cached will still see the cached image, that is where asset timestamps come into play. Those numbers represent a timestamp of when the file was updated, so if you replace file.jpg?123456789 with file.jpg?987654321 then the user's browser will not use the cached version.
http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html
long story short, it is only there to help you, and doesn't affect the way the file behaves at all. Users can still download the file and operating systems will see it as being a valid .jpg.
thats your development mode making sure that nothing gets cached so that if you change the image it actually gets to the browser. the production version won't have it.
Solved, add this to environment.rb => ENV['RAILS_ASSET_ID'] = ''
Conclusion: yes, its a good rails stuff, but when you deal with ie6 and PNG images it can break your script. So be careful.

Resources