Crop filter with JpegRenderer not working



Hello,
I am trying to do a square (1:1) crop of an image that came from a 16:9 or 4:3 source and use the JpegRenderer to make an image stream for saving to disk. Unfortunately, instead of doing a square crop, JpegRenderer is just squishing the image to fit into a 1:1 space. Can the JpegRenderer handle an aspect ratio change, or do I have to render it to an intermediate object before rendering it out to jpeg? Thank you for any help!

Related to : Crop filter with JpegRenderer not working
Crop filter with JpegRenderer not working
Mobile Programming
Hello,
I am trying to do a square (1:1) crop of an image that came from a 16:9 or 4:3 source and use the JpegRenderer to make an image stream for saving to disk. Unfortunately, instead of doing a square crop, JpegRenderer is just squishing the image to fit into a 1:1 space. Can the JpegRenderer handle an aspect ratio change, or do I have to render it to an intermediate object before rendering it out to jpeg? Thank you for any help!
[ubuntu] ffmpeg crop filter
Mobile Programming
am i right in saying that if i want to crop 40 pixels fro the top of a video and 60 pixels from the bottom, i would have to do it over two different conversions.
my understanding is this would crop the top. crop 40 pixels from position y=0
-vf crop=in_w-0:in_h-40:0:0
and this would crop the bottom. crop 60 pixels from position y=516
-vf crop=in_w-0:in_h-60:0:516
is this correct???
also is it possible to crop from right to left,bottom to top rather than left to right, top to bottom?
Android Center Crop Image Not working on device but working in Eclipse
Mobile Programming

I have a list view with an image background for each list item. I am trying to set the src by downloading an image from a given url. I need to center crop the ImageView view so that the image occupies the entire screen (width and height).

This is the XML for my list item:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/list_item"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/img_askers_collage"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:scaleType="centerCrop"/>

    <LinearLayout
        android:id="@+id/ll_question_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginBottom="40dp"
        android:layout_marginTop="50dp"
        android:gravity="center"
        android:orientation="vertical" >

        <me.frankly.view.BariolBoldTextView
            android:id="@+id/question_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
           
android:layout_marginLeft="@dimen/activity_horizontal_margin"
           
android:layout_marginRight="@dimen/activity_horizontal_margin"
            android:gravity="center"
            android:textColor="@color/white_pure"
            android:textSize="22sp" />

        <RelativeLayout
            android:id="@+id/author_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp" >

            <me.frankly.view.BariolTextView
                android:id="@+id/leading_text_author"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/leading_text_author"
                android:textColor="@color/white_pure"
                android:textSize="17sp" />

            <me.frankly.view.BariolTextView
                android:id="@+id/question_author_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/leading_text_author"
                android:paddingLeft="5dp"
                android:textColor="@color/comment_username"
                android:textSize="17sp" />
        </RelativeLayout>
    </LinearLayout>

</RelativeLayout>

This is the main activity layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/default_background" >

    <include
        android:id="@+id/answer_question_action_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        layout="@layout/action_bar_backbtn_text" />

    <View
        android:id="@+id/view_answer_question"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@id/answer_question_action_bar"
        android:layout_alignTop="@id/answer_question_action_bar" >
    </View>

    <ListView
        android:id="@+id/asked_question_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/view_answer_question"
        android:cacheColorHint="#00000000"
        android:divider="@null"
        android:dividerHeight="0dp" >
    </ListView>

</RelativeLayout>

And this is the snippet which sets the image inside getView of the Adapter, ImageLoader is from UIL:

ImageLoader.getInstance().loadImage(askersCollageUrl, new
ImageLoadingListener() {

                    @Override
                    public void onLoadingComplete(String arg0, View
arg1, Bitmap arg2) {

                        if (holder.askersCollageUrl.equals(arg0)) {
                        Drawable d = new
BitmapDrawable(mcontext.getResources(), arg2);

                           
holder.collageImageView.setImageDrawable(d) ; 


                        }
                    }

                //Omitting other methods heere

                });

Imagemagick crop not working
Mobile Programming

I was trying to perform a crop on a image using imagemagick. It did not give the results I expected. I decided to set the crop value to 0 to try and find the error. With a crop value of 0 the image was still being cropped.

Here is the code:

$img = new Imagick();
$img->setResolution(200,200);
$img->readImage("{$FileName}[$PageNumber]");
$img->trimImage($Tolerance);
$img->enhanceImage();
$width = $img->getImageWidth();
$height= $img->getImageHeight();
$img->cropImage($width, $height,0,0);
$img->setImagePage(0,0,0,0);
$img->setImageFormat('jpeg'); 
$img->setImageCompressionQuality(90); 
$img = $img->flattenImages();
file_put_contents ($ImagesPath.$ImageName, $img); 

I would appreciate if anyone could tell me what I am doing wrong. Surely a crop value of 0 should not crop at all.

Thanks!

Cymro


CS6 Camera Raw - I can now only crop using aspect ratio in the custom crop setting rather than being able to set the dims in cm and inches? anyone kno
Mobile Programming

CS6 Camera Raw - I can now only crop using aspect ratio in the custom crop setting rather than being able to set the dims in cm and inches? anyone know how to revert? ever since installing new mac operating system things have been strange!


AEM 6.0 Image crop tools (using Free Crop / Ratio Crop) not functioning properly but working in CQ 5
Mobile Programming

I'm having a concern on the Image Crop Tool in AEM 6.0.

I had an existing code working in CQ5 (with regards to Image Crop Tool), but when I tried to use AEM6.0, this certain tool won't work properly anymore.

When I try to crop the image, it doesn't really do the cropping, the original image will just be displayed.

No error is being displayed to the logs that makes it more complicated. I am using com.day.cq.wcm.commons.AbstractImageServlet class for this.

Does anyone who could help on this? Is there any enhancement or changes from CQ5 to AEM6 with regard to this tool?

Below is a snippet of the image:

<tab_image_wide
        jcr:primaryType="cq:Widget"
        allowUpload="{Boolean}false"
        cropParameter="./imageWide/imageCrop"
        ddGroups="[media]"
        fileNameParameter="./imageWide/fileName"
        fileReferenceParameter="./imageWide/fileReference"
        itemId="tab_image_wide"
        name="./imageWide/file"
        requestSuffix="/imageWide.img.png"
        title="Image (Wide)"
        xtype="smartimage">
        <cropConfig jcr:primaryType="cq:Widget">
            <aspectRatios jcr:primaryType="cq:Widget">
                <freeCrop
                    jcr:primaryType="cq:Widget"
                    text="Free Crop"
                    value="0,0"/>
                <wideScreen
                    jcr:primaryType="cq:Widget"
                    text="Widescreen (16:9)"
                    value="16,9"/>
            </aspectRatios>
        </cropConfig>
    </tab_image_wide>

Thanks,



HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .