Compare commits
2 Commits
472efbb9d9
...
ea1a6e58f4
Author | SHA1 | Date | |
---|---|---|---|
ea1a6e58f4 | |||
0c3e5e21bf |
@@ -109,8 +109,8 @@ class ProjectView:
|
||||
self.selected_index = 0
|
||||
self.scroll_offset = 0
|
||||
self.items_per_row = 2 # Default to 2 items per row
|
||||
self.window_width = 1200
|
||||
self.window_height = 800
|
||||
self.window_width = 1920 # Increased to accommodate 1080p videos
|
||||
self.window_height = 1200
|
||||
|
||||
self._load_video_files()
|
||||
self._load_progress_data()
|
||||
@@ -511,8 +511,8 @@ class VideoEditor:
|
||||
# Mouse and keyboard interaction
|
||||
self.mouse_dragging = False
|
||||
self.timeline_rect = None
|
||||
self.window_width = 1200
|
||||
self.window_height = 800
|
||||
self.window_width = 1920 # Increased to accommodate 1080p videos
|
||||
self.window_height = 1200
|
||||
|
||||
# Auto-repeat seeking state
|
||||
self.auto_repeat_active = False
|
||||
@@ -791,8 +791,9 @@ class VideoEditor:
|
||||
processed_frame = self.apply_crop_zoom_and_rotation(self.current_display_frame.copy())
|
||||
|
||||
if processed_frame is not None:
|
||||
# Save the processed frame
|
||||
success = cv2.imwrite(str(screenshot_path), processed_frame)
|
||||
# Save the processed frame with high quality settings
|
||||
# Use JPEG quality 95 (0-100, where 100 is highest quality)
|
||||
success = cv2.imwrite(str(screenshot_path), processed_frame, [cv2.IMWRITE_JPEG_QUALITY, 95])
|
||||
if success:
|
||||
print(f"Screenshot saved: {screenshot_name}")
|
||||
self.show_feedback_message(f"Screenshot saved: {screenshot_name}")
|
||||
@@ -1872,23 +1873,39 @@ class VideoEditor:
|
||||
height, width = display_frame.shape[:2]
|
||||
available_height = self.window_height - (0 if self.is_image_mode else self.TIMELINE_HEIGHT)
|
||||
|
||||
# Don't downscale - keep original video quality
|
||||
# If video is larger than window, we'll handle it by resizing the window
|
||||
scale = min(self.window_width / width, available_height / height)
|
||||
if scale < 1.0:
|
||||
new_width = int(width * scale)
|
||||
new_height = int(height * scale)
|
||||
display_frame = cv2.resize(display_frame, (new_width, new_height))
|
||||
# Resize window to fit video instead of downscaling video
|
||||
new_window_width = int(width * 1.1) # Add 10% padding
|
||||
new_window_height = int(height * 1.1) + (0 if self.is_image_mode else self.TIMELINE_HEIGHT)
|
||||
|
||||
# Update window size
|
||||
self.window_width = new_window_width
|
||||
self.window_height = new_window_height
|
||||
|
||||
# Resize the OpenCV window
|
||||
window_title = "Image Editor" if self.is_image_mode else "Video Editor"
|
||||
cv2.resizeWindow(window_title, self.window_width, self.window_height)
|
||||
|
||||
# Create canvas with timeline space
|
||||
canvas = np.zeros((self.window_height, self.window_width, 3), dtype=np.uint8)
|
||||
|
||||
# Center the frame on canvas
|
||||
frame_height, frame_width = display_frame.shape[:2]
|
||||
available_height = self.window_height - (0 if self.is_image_mode else self.TIMELINE_HEIGHT)
|
||||
start_y = (available_height - frame_height) // 2
|
||||
start_x = (self.window_width - frame_width) // 2
|
||||
|
||||
canvas[start_y : start_y + frame_height, start_x : start_x + frame_width] = (
|
||||
display_frame
|
||||
)
|
||||
# Ensure frame fits within canvas bounds
|
||||
end_y = min(start_y + frame_height, available_height)
|
||||
end_x = min(start_x + frame_width, self.window_width)
|
||||
actual_frame_height = end_y - start_y
|
||||
actual_frame_width = end_x - start_x
|
||||
|
||||
if actual_frame_height > 0 and actual_frame_width > 0:
|
||||
canvas[start_y:end_y, start_x:end_x] = display_frame[:actual_frame_height, :actual_frame_width]
|
||||
|
||||
# Draw crop selection preview during Shift+Click+Drag
|
||||
if self.crop_preview_rect:
|
||||
@@ -2700,8 +2717,8 @@ class VideoEditor:
|
||||
processed_image = self.apply_crop_zoom_and_rotation(self.static_image.copy())
|
||||
|
||||
if processed_image is not None:
|
||||
# Save the image
|
||||
success = cv2.imwrite(output_path, processed_image)
|
||||
# Save the image with high quality settings
|
||||
success = cv2.imwrite(output_path, processed_image, [cv2.IMWRITE_JPEG_QUALITY, 95])
|
||||
if success:
|
||||
print(f"Image saved successfully to {output_path}")
|
||||
return True
|
||||
|
Reference in New Issue
Block a user