Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
edited by

I just ran into a problem where the avatar images cannot be displayed, but only if they are scaled or sized below 107 pixels.  When copy the URL to directly open the image in a new window:


The image appears very nicely, however, if I change the URL to size the image to something lower than 107 pixels:


I get a server 500 error.

This all started happening when we migrated everything to a new environment.  I copied the Question2Answers site code over, exported from MySQL and imported into the new database with the same MySQL version (using a hex export option just in case).  In both the old and new environment, we're running IIS7 with the query re-write module installed on both sides.  The web.config files are basically identical.  The only difference I can see is that we've implemented SSO in the new environment.

None of that seems related, however, since the images appear fun if the qa_size is set to 107 or above.  So, my user list has a bunch of broken avatar images (qa_size=30) and if I change that setting in the admin screen to be 107 pixels instead of 30, it works (unless the image is smaller than 107 pixesl, in which case it can't be found.

I read a post that was for a bug in 1.5.1 that talked about something similar but I'm running 1.5.2 so I didn't think this was related.

Any help would be appreciated.

UPDATE: Since this started to happen when we migrated to a new production environment, I decided to point one of our environments back to the original database to see if that caused the problem to go away - it didn't.  That clearly indicates that this is not a problem with the database and since the Question2Answer code is the same, it counterindicates it as an issue as well.  Something about the server configuration is causing this - either the server, the OS, IIS or the PHP install.  Still no solution.

UPDATE 2: Interestingly, when my server admin tries to do this on the server itself, it works fine.  It just doesn't work remotely.

UPDATE 3: I'm starting to think this is related to URL Rewrite and SiteMinder (which is providing SSO for the site).  On the General Admin page, none of the icons for URL rewrite options say "OK".  This is the only thing that I can see that could impact the image scaling, RSS feeds (did I mention they stopped working) and Ajax calls (some of those have stopped as well, including the related questions lookup used on the New Question form).

Q2A version: 1.5.2

2 Answers

0 votes
Best answer
We have resolved this issue but I don't understand why it was happening.

We had made a core Q2A code change to add a simple SSO implementation to our site.  That code change was doing a qa_redirect('') at the end which we changed to qa_redirect_raw($_SERVER["REQUEST_URI"]);

This was used to solve a seemingly unrelated problem but ended up solving many problems we were seeing throught the site after we implemented our SSO change.

What I don't understand is how this fixed the qa_size issue I refer to above.
+1 vote
Have you tried to upload a new avatar after you migrated your script/database?
Yes, several times. I've also verified that the fix in 1.5.2 that fixed a similar issue is included in the base code for both sites I'm running (the old sides where things work, and the new site).  The fact that it appears to only happen for images below a size (either natively or through scaling) is just plain strange