If you are having a notice about writing the .mo files please read this doc

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by uweS-2 9 months, 1 week ago.

Assigned support staff: Yvette.

Author Posts
August 31, 2018 at 8:11 am

uweS-2

In November 2017 it was said that the problem should have been fixed with the "next release". Meanwhile some versions have been released and this problem is still not solved.

Image resizing does not work on alternate language versions (as per 'different domain per language'). With the standard language everything is fine, but when switching to a differnet language I got tons of errors with 'aq_resizer-1x.php'.

See more at: https://wpml.org/forums/topic/image-resizing-on-additional-domains/

August 31, 2018 at 9:39 am #2693138

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hello

Thanks for bringing this to our attention. I´ve traced the development notes related to this issue and here are the steps that were done to test the "fix" version:

Steps
Setup WPML in 2 languages, EN (default) + French
Upload new image
Click on that new image, and then on "Edit image"
Crop image, and close box
Expected: Media Library -> When switching admin language (with top LS) the images look identical
Expected: DB table post_meta, "_wp_attachment_metadata" -> data in this entry is identical for both original and translated post_id

Repeat steps 3-6 for actions "Rotating" + "Flip" + "Restore image (EN)"
Make also sure that data for Caption, Alt Text and Description is synchronized

1. Are these steps reflective of the actions that you do when resizing the image?

2. With your system, please detail steps like I have done to replicate the issue on your site. Be specific and detailed.

3. Once I am able to replicate the issue, I will be able to escalate your ticket back to development team.

Kind regards.

August 31, 2018 at 10:33 am #2693299

uweS-2

You misunderstood. It's not about manually editing image sizes. The problem occurs when images need to be automatically displayed in a different size (e.g. in "recent posts" element).

Look at the error closely (especially at the image path):

Warning: getimagesize(/kunden/319258_22761/webseiten/wordpress.ic-gruppe.com/wp-content/hidden link): failed to open stream: No such file or directory in /kunden/319258_22761/webseiten/wordpress.ic-gruppe.com/wp-content/themes/pr/includes/plugins/aq_resizer-1x.php on line 80

The part "hidden link" is incorrectly inserted into the path and therefore the asset to be resized cannot be found.

August 31, 2018 at 12:22 pm #2693681

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

OK - I got this now.

You opened this ticket years ago regarding same issue:
https://wpml.org/forums/topic/old-problem-back-team-image-sizes-wrong/page/3/

Which resulted in our team adding a patch to the file aq_resizer-1x.php and forwarding the fix to the code author for adoption here:
hidden link

It is not clear if the author ever implemented the code fix or not. And I should be clear that this is a change in code in aq_resizer-1x.php and not in any WPML code.

Here is a summary of the code changes.
hidden link

Can you confirm if this code is in your version of aq_resizer-1x.php?

It should look something like this:

/* WPML Fix for Image issue in Different domain per language */
if ( defined( 'ICL_SITEPRESS_VERSION' )){
global $sitepress;
$url = $sitepress->convert_url($url,$sitepress->get_default_language());
}
/* WPML Fix for Image issue in Different domain per language */     

If this code is not present, then you need to reapply it as long as the author of this file does not include it in the code.

September 1, 2018 at 8:32 am #2695788

uweS-2

See, that's the thing: The fix is present and it doesn't work, though.

In the other ticket it was said that this recured error was detected and should have beeen fixed with a next version. Unfortunately, that never happened ...

September 2, 2018 at 10:19 am #2696901

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

In this case, it may be that the original fix no longer works (as you said) and the subject must be revisited. Here is what I will need from you:

1. A Duplicator package (which you have already provided) that I can install on my local system to replicate the issue

2. Exact steps to replicate the problem (include annotated screenshots if you can)

I´ll be attempting to install the package you provided. Please send detailed steps that I can forward to our compatibility team to re-open.

I am also including all the links to your previous forum and internal threads.

September 3, 2018 at 9:28 am #2698501

uweS-2

Replicating the problem is easy:

With the default language domain the issue doesn't occur (e.g. when loading the home page hidden link - scroll down to 'recent posts' element and you'll see correctly resized thumb images with aspect ratio = 4:3). When switching to German language hidden link resizing doesn't work (aspect ratio = original image) and with DEBUG=true you'll get the above mentioned errors:

Warning: getimagesize(/kunden/319258_22761/webseiten/wordpress.ic-gruppe.com/wp-content/hidden link): failed to open stream: No such file or directory in /kunden/319258_22761/webseiten/wordpress.ic-gruppe.com/wp-content/themes/pr/includes/plugins/aq_resizer-1x.php on line 80

The part "hidden link" is incorrectly inserted into the path and therefore the asset to be resized cannot be found.

September 4, 2018 at 2:10 am #2701400

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Thanks.

This ticket is now escalated to our compatibility team for further follow-up and work.

September 5, 2018 at 9:19 pm #2708775

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hello

The following code was added to these locations:

File: includes/plugins/aq_resizer-1x.php
line: 28

File: includes/plugins/aq_resizer-2x.php
line: 67

/* WPML Fix for Image issue in Different domain per language */
        if ( defined( 'ICL_SITEPRESS_VERSION' )){
            global $sitepress;
            $upload_url = $sitepress->convert_url($upload_url, $sitepress->get_default_language());
        }

This is the same kind of fix applied previously but for the variable $upload_url.

I have to repeat that this code fixes a 3rd party library and not WPML code. This is the code merge request that has been outstanding for a long time:
hidden link

Can you please test the fix and let me know if it works for you?
Thanks

September 5, 2018 at 10:51 pm #2708862

uweS-2

At first glance, it looks like it's working. I'm going to test it extensively now.

Thank you!

September 6, 2018 at 9:51 am #2710212

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Great - please close this ticket if you find that all is ok. Also, remember that these modifications will be required to be re-implemented by you until the aq-resizer library is fixed.

I remind you that we are not responsible for the library code and although we have requested the changes be made to the author(s), the matter is mostly out of our hands.

February 10, 2019 at 3:37 pm #3179928

uweS-2

The fix from #2708775 doesn't work anymore - has any change been made to a string?