Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hello,

My clients website is using CouchCMS 1.4.7
There's a bunch of clonable pages that acts as profiles. So a bunch of actors, speakers, and stuff got their profile on this site (photo, biography, etc.).

My client called me around 2 months ago saying that after like 1 year of working correctly, suddenly, the photo of one of the profile disapeared. I checked on the server, and the file name that was entered in the admin, and the file name on the actual server was different. So I just changed the name in the image upload field for the good one that was on the server.

Everything was fine.

And today, they called me saying around 10 profiles got missing photos.
I asked them if they changed anything in the admin panel, and they said they haven't touched it for weeks.

I went to see the file names of the files they uploaded, and it seems like they all have accent or non-standard characters.
For example :

Jean-Page¦ü-portrait-smoking-200x257.jpg
©AG_4081site-200x257.jpg
PAtrick-recadré-2013-200x257.jpg
...
And so on. All have accents like "é", and other stuff.

I went on the server, and it seems like Couch is renaming the files like so :

Jean-Page¦ü-portrait-smoking-200x257.jpg = jean-pageu-portrait-smoking-200x257.jpg
©AG_4081site-200x257.jpg = cag_4081site-200x257.jpg
PAtrick-recadré-2013-200x257.jpg = patrick-recadre-2013-200x257.jpg

So it removes all uppercase letters, and special characters (and characters with accents).

This is causing an issue for my client, since it changes the file name on the server, but doesn't update the file name in the image upload field in the admin panel. So it results as a broken image.
What I find weird is that it was working fine for over a year. And without changing anything, it started working not so well.

Any idea how to fix this other than telling my client to rename his files to something without any accents, uppercase letters and special characters?

Thank you
Hi,

The type 'image' region you mentioned is actually primarily just used to select an *already* existing image on the server.

If an image is not present, please notice that we follow a two-step process -

1. we upload a local image using the attached (KCfinder) file-browser, (this, as a part of the upload process, sanitizes the image-name removing the accents and some other characters).

2. we next select the uploaded image which causes its name to appear in the type 'image' region - please again notice that for this step, the image being selected was already present on the server (which is the point I began with).

The point I am trying to make is, when at step 2 above we select an image, the name that would end up in the image region would necessarily be the one that resulted from step 1 before it i.e. the sanitized unaccented name.

There is no way for the image region to figure out by itself what the original name was given the sanitized name.

Do you see what I am hitting it?
If the image name was changed during upload (which is normal), it is this changed name that can appear in the image region - if you are actually selecting the image that gets uploaded to the server.

Now, as to why there is this name dichotomy in your client's case, I am not sure about the cause but it is definitely not because of the upload and select process.

Perhaps the client is bypassing the two-step process and uploading the images *directly* to the server using some other utility (e.g. FTP or Cpanel) - as this way the sync between the names could break.

As I said, I am not sure about the real cause.
Please ask your client more about exactly what process they are following to upload the images.

Do let me know. Thanks.
Thanks KK.

Well, my client is only using the Couch admin panel, nothing else.
And like I said, there's profile on the site that was added a year ago, and out of nowhere, decided to break the image link.
Again, my client only has access to the couch admin, and does nothing but adding profiles and uploading images.

Another weird thing I have noticed is that the upload seems to be uploaded twice on the server.

Every images are like this :

dreams-2-031-200x257.jpg
and right after on the server files list:
dreams-2-031-200x257(1).jpg

The image region that handle these images is the following:
Code: Select all
<cms:editable type='image' group='group_main_profile' name='profile_image' label="Photo de profile" order="2" />


On the page where you can create profiles (clonable page - profile.php), there's no other fields using the same name.
Any idea why it seems to be double uploading the file? Can it be linked with my main issue?
One thing that strikes me as curious is that all the image names you mentioned have something like "-200x257" in their names.
Such names, in Couch, are created/used by type 'thumbnail' regions i.e. such images are 'thumbnails' attached to the main uploaded image. That is to say, numbers formatted like "-200x257" used within file names have special significance for Couch.

For example, if a main image is named 'some-image-02.jpg', its thumbnail (found in the same folder) would have a name like 'some-image-02-150x150'.

Is it possible that the client is uploading the main images with these kind of names?
Or is it that the images you have referring to are actually thumbnails and the main image is different?
Please verify and let me know.

Also, are there thumbnail regions attached to the image? If so, please check if there multiple regions using identical values for 'height' and 'width' parameters as this could lead to thumbnails of the same names.
Thanks for your reply.

Oh! I remember now.
These numbers are from a CSV I have imported back in the days.
So the files were already named with these dimensions at the end. They were from another website my client had.

So it is not Couch that is adding these numbers. They were already there.

So the images in the CSV file name are something like
dreams-2-031-200x257.jpg

And then, maybe we re-imported some stuff, and it made a copy on the server. That makes sense.
On import, Couch probably changed the file name to something without accents and stuff, but the upload field must of been filled with what the CSV had. That's probably why the content of the image field is not matching what is on the server right now.

Does it make more sense?

The URL of that was entered for the image field is :
"images/photos-profiles/Portrait-A.Dubuc_-200x257.jpg"
(that's from imported from the CSV file profiles)

And here's how it looks like from an image that has been uploaded from the admin (not imported) :
https://www.DOMAIN.com/edit/uploads/ima ... -200x257(1).jpg
(DOMAIN being just to hide the real domain)

But both are working.
What I don't get is why out of nowhere, some stops working after a while, and my client said he haven't changed anything to the profiles that the image disappeared.

Things are getting clearer, but still, I don't know what's going on.

Thanks KK!
Any ideas? Thanks
The CSV import scenario you mentioned seems to be the most logical explanation.
I, however, cannot figure out how/why things are changing without user intervention.

If you could point me to some specific instances of such images and where I could find them, feel free to PM me the FTP (and Couch) access creds and I can take a look at the setup, if you so wish.
7 posts Page 1 of 1